Preheat the oven to 375°F (190°C). Grease an 8½ x 10½-inch deep casserole dish with cooking spray and set aside.
Bring a large pot of salted water to a boil. Add the pasta and cook until just under al dente according to package directions. Drain and set aside.
Meanwhile, melt the butter in a medium saucepan over medium-high heat. Add the chopped red onion and sauté until softened, about 3 minutes.
Add the minced garlic and cook 1 minute more, stirring so it does not brown.
Sprinkle the flour over the onions and garlic and stir constantly for 2–3 minutes to cook the flour.
Gradually whisk in the milk and bring the mixture to a gentle boil, whisking until smooth and slightly thickened.
Remove the sauce from the heat and stir in the shredded mozzarella and one-third of the crumbled feta until mostly melted and combined.
Stir in the dried oregano, dried marjoram or thyme, freshly ground black pepper to taste, the quartered tomatoes, chopped Kalamata olives, chopped spinach, and about 1/4 teaspoon kosher salt (adjust more if needed).
Toss the drained pasta with the sauce until well combined, then transfer everything to the prepared casserole dish and spread evenly.
Sprinkle the remaining crumbled feta over the top and bake in the preheated oven for 20–22 minutes, or until the top is golden and the dish is heated through.
Remove from the oven and garnish with fresh dill or parsley before serving.