In a large pot of boiling salted water, cook orzo according to package instructions, about 9 minutes. Drain well.
Heat olive oil in a medium saucepan over medium heat. Add garlic and onion and cook, stirring frequently, until aromatic and translucent, 2-3 minutes.
Whisk in flour until lightly browned, about 1 minute. Gradually whisk in milk and cook, whisking constantly, until slightly thickened, about 3-4 minutes.
Add chopped spinach and cook until wilted, 2-3 minutes. Stir in Parmesan until melted, about 1 minute. Add orzo to saucepan and gently toss to combine. Season with salt and pepper, to taste. Serve hot.