Bring a pot of salted water to a boil and cook the elbow macaroni according to package directions; drain and set aside.
In a large saucepan over medium heat, melt the butter. Add the finely minced onion and sauté until softened, about 5 minutes.
Whisk in the flour and cook until the mixture is golden and bubbly, about 1 to 2 minutes.
Slowly whisk in the whole milk, then the 2% milk. Increase heat to medium-high and bring to a simmer, whisking constantly, until the sauce is smooth and thickened, about 10 to 12 minutes.
Season the sauce with kosher salt and freshly ground black pepper to taste.
Add the chopped spinach to the sauce and stir until wilted, about 1 to 2 minutes.
Stir in the shredded cheddar, shredded smoked gouda, and crumbled goat cheese until fully melted and the sauce is smooth.
Add the cooked macaroni to the cheese sauce and stir until evenly coated. Taste and adjust salt and pepper if needed, then serve immediately.