Melt the butter in a large ovenproof skillet over medium-high heat. Add the leeks, thyme, 1/2 teaspoon salt and a few grinds of pepper. Cook, stirring, until the leeks are tender, 8 to 10 minutes. Add the ham and cook until warmed through, about 2 minutes. Add the flour and cook, stirring, until moistened, 1 minute. Add the half-and-half and bring to a boil, then reduce to a simmer and cook until slightly thickened, about 2 minutes. Stir in 1 cup fontina until melted.
Meanwhile, preheat the broiler and bring a large pot of salted water to a boil. Add the pasta and cook as the label directs for al dente, adding the peas in the last 2 minutes of cooking. Reserve 1/2 cup cooking water, then drain the pasta and peas.
Add the pasta and peas to the skillet and toss to coat, adding the reserved cooking water as needed to loosen; season with salt and pepper. Top with the remaining 1 cup fontina and the parmesan. Broil until lightly browned, 4 to 5 minutes.