Boil a pot of salted water and add the spinach. Boil for 5 minutes, strain, remove, and blanch the spinach in cold water to stop the cooking process.
Melt the butter in a saute pan on medium heat and add the onion and garlic and cook until the onions are translucent.
Turn the heat to low and add the flour. Stir to allow the flour to absorb all the fat and cook evenly for a few minutes.
Add the milk, whisking constantly until the sauce thickens (about 5 minutes). When it thickens, add the broth and continue whisking. Season with salt, pepper, and if using, nutmeg.
Add the cheese and whisk until fully melted and incorporated. Once the cheese has melted and the sauce is smooth, add the spinach and stir to incorporate until evenly distributed.
Serve immediately. Store any leftovers in an airtight container for up to three days in the refrigerator.