Preheat oven to 350°F (175°C).
Cook rigatoni in boiling salted water until al dente, about 2 minutes less than package instructions. Reserve 1/2 cup pasta water, then drain.
Heat olive oil in Dutch oven over medium heat. Sauté diced onion and minced garlic until soft and fragrant.
Add ground beef and cook until browned. Drain excess grease.
Return pot to stove and stir in crushed tomatoes, tomato sauce, salt, pepper, and red wine if using. Add basil leaves and simmer on low for 15-20 minutes.
In a small saucepan, melt butter over medium-low heat. Whisk in flour until smooth, then slowly add warmed milk and nutmeg, whisking until thickened.
Combine drained pasta with meat sauce in pot until well mixed.
Spray casserole dish with cooking spray. Layer half the pasta mixture, drizzle half the béchamel sauce, and sprinkle half the mozzarella and Parmesan cheeses. Repeat layers.
Cover dish with foil and bake for 35 minutes. Remove foil and bake an additional 5 minutes until golden and bubbly.
Allow to cool slightly before serving.