Preheat the oven to 425 degrees. Bring a large pot of salted water to a boil. Add the ziti and cook until al dente, about 6 minutes. Drain and transfer to a large bowl; toss with 1/4 cup milk.
Meanwhile, combine both cheeses in a bowl. Beat 1/4 cup milk and the eggs in another bowl; fold in the bread and add half of the cheese.
Melt the butter in a saucepan over high heat. Add the onion and garlic; cook, stirring, until just brown, 2 minutes. Sprinkle in the flour, cayenne, nutmeg and 1 teaspoon Kosher salt; cook, stirring, about 2 minutes. Slowly add 3/4 cup water and the remaining 1 1/2 cups milk; bring to a boil, stirring until thickened. Remove from the heat and whisk to cool slightly. Whisk in the remaining cheese, then add the pasta and toss.
Butter a shallow casserole dish. Add half of the pasta, top with some of the ham and cover with the remaining pasta. Top with the remaining ham, then cover with the bread mixture. Bake until golden and bubbly, about 20 minutes. Let rest a few minutes before serving.