Preheat and prep: Heat your oven to 400°F (200°C). Break the spaghetti in half so it fits easily in the pot.
Brown the meat: In a large oven-safe pot or Dutch oven, heat olive oil over medium-high. Add ground beef, breaking it up as it cooks until browned and no longer pink, about 5–7 minutes.
Drain excess fat if needed.
Build flavor: Add onion and cook until softened, 3–4 minutes. Stir in garlic, oregano, basil, red pepper flakes, salt, and black pepper. Cook 30–60 seconds until fragrant.
Add liquids: Pour in marinara and broth.
Stir to combine and bring to a gentle simmer.
Cook the pasta: Add the spaghetti, submerging the strands. Reduce heat to medium-low, cover, and simmer 10–12 minutes, stirring every few minutes to prevent sticking. Add a splash more broth or water if it looks too dry.
Pasta should be just shy of al dente.
Cheesy layer: Remove from heat. Stir in the ricotta, 1 cup mozzarella, and 1/4 cup Parmesan until creamy and evenly distributed. Taste and adjust salt.
Top and bake: Sprinkle the remaining mozzarella and Parmesan over the top.
Transfer the pot to the oven and bake 8–10 minutes, until the cheese is melted and bubbling.
Optional broil: For golden, bubbly edges, broil 1–2 minutes. Watch closely.
Rest and serve: Let it stand 5 minutes to set. Garnish with fresh basil or parsley and serve warm.