Heat the oven to 425°F.
Drizzle a little bit of olive oil into the baking dish to help prevent the orzo from sticking. Add the orzo, garlic, salt, red pepper flakes, several grinds black pepper, and the remaining 1 tablespoon oil and stir to evenly coat the orzo. Spread into an even layer.
Scatter the halved cherry tomatoes over top, flipping most of them so they're facing upwards (this is a lot less fussy than it sounds). Pour the broth over the tomatoes, followed by the milk.
Bake, uncovered, until the orzo is very al dente, 25 to 30 minutes.
Remove the baking dish from the oven. Add the beans, spinach, and half the cheese and stir to combine, making sure to release any stuck-on orzo at the bottom of the dish. Scatter the remaining cheese over top.
Return the baking dish to the oven until the cheese is melted, 5 to 10 minutes.
Let rest for 5 minutes, then season to taste with salt and pepper. Serve warm, drizzled with pesto or balsamic glaze.