Preheat Oven – Preheat to 375°F (190°C) and lightly grease a 9x13-inch baking dish.
Cook Pasta – Boil spaghetti in salted water until al dente (about 8-10 mins). Drain and set aside.
Brown Meat – In a skillet, heat olive oil over medium heat. Add onions and garlic, sauté for 2 mins. Add ground beef, breaking it apart, and cook until browned. Drain excess fat.
Combine Sauce & Pasta – Stir in marinara sauce, Italian seasoning, salt, and pepper. Simmer for 5 mins. Mix in cooked spaghetti.
Layer & Bake – Transfer half the pasta mix to the baking dish. Sprinkle with 1 cup mozzarella. Add remaining pasta, then top with remaining mozzarella and parmesan.
Bake – Cover with foil and bake for 20 mins. Uncover and bake for 5-10 mins until cheese is bubbly and golden.
Rest & Serve – Let cool for 5 mins before serving. Garnish with fresh basil if desired.