Preheat the oven to 350°F (175°C).
Cook spaghetti according to package instructions until al dente; drain.
In a skillet, brown ground beef over medium heat; drain excess fat.
Add chopped onion and minced garlic to the skillet; sauté until soft.
Stir in marinara sauce and Italian seasoning; simmer for 5 minutes.
In a large bowl, combine cooked spaghetti, ricotta cheese, and half of the mozzarella.
Mix in the meat sauce until well combined.
Transfer the mixture into a greased 9x13 inch baking dish.
Top with remaining mozzarella cheese.
Bake in the preheated oven for 25-30 minutes or until cheese is bubbly and golden.