Preheat the oven to 375 degrees and lightly grease a baking dish.
Bring a large pot of salted water to a boil. Add the macaroni and cook for 6 minutes, then stir in the broccoli florets and cook for 2 more minutes. Drain and set aside.
In a medium saucepan, melt the butter over medium heat. Whisk in the flour and cook for 1 minute. Slowly pour in the milk while whisking until the mixture thickens.
Remove the saucepan from the heat and stir in the cheddar cheese, salt, and pepper until the sauce is smooth.
Combine the drained pasta and broccoli with the diced ham in a large bowl. Pour the cheese sauce over the mixture and stir gently to coat everything evenly.
Transfer the mixture to the prepared baking dish and sprinkle the panko breadcrumbs evenly over the top.
Bake for 20 minutes, or until the topping is golden and the edges are bubbling. Let it rest for 5 minutes before serving.