Preheat your oven to 375°F and adjust the rack to the top third of the oven.
Boil salted water in a large pot. Add the spaghetti and cook for 2 minutes less than the package instructions. Drain the spaghetti and transfer it to a 9x13 casserole dish.
In a skillet, cook the ground beef, chopped onion, oregano, and optional red pepper flakes over medium-high heat. Stir until the beef is browned and the onions are soft, about 5–7 minutes.
Stir in the minced garlic and cook for an additional minute. Then, add the marinara sauce to the skillet, stirring until warmed through.
Pour the beef and sauce mixture over the spaghetti in the casserole dish. Toss everything gently to coat the spaghetti evenly. Spread the mixture evenly across the dish.
Baking
Top the spaghetti mixture with mozzarella, cheddar, and parmesan cheeses. Bake uncovered for 20 minutes until the cheese is melted and bubbly.
If desired, broil for a couple of minutes to lightly brown the cheese. Let the dish sit for 5–10 minutes before serving. Garnish with fresh parsley if you like.
Notes
Cook pasta al dente, use fresh ingredients for better flavor, and cover while baking if the cheese browns too quickly.