Bring a large pot of salted water to a boil. Cook the pasta according to the package directions, adding the peas for the last 2 minutes.
Scoop out ½ cup of the pasta water, then drain the pasta and peas.
Return the pot to medium heat and melt the butter. Add the garlic and cook for 30 seconds. Whisk in the flour and cook for 1 minute.
Slowly whisk in the milk. Simmer for 3–4 minutes, whisking often, until the sauce thickens enough to coat a spoon.
Stir in the Parmesan, ham and pepper.
Add the pasta and peas and toss to coat, adding a splash of the pasta water if the sauce is too thick. Taste and add salt if needed.