- Bring a large pot of salted water to a boil. Add the spaghetti and cook according to package instructions until just al dente, about 8 to 9 minutes. Drain the pasta in a colander and set aside. 
- In a large skillet over medium heat, add the ground beef. Break it apart with a spatula as it cooks. After 4 to 5 minutes, when mostly browned, add the diced onion and minced garlic. Continue cooking until beef is fully browned and onions are softened, about 3 more minutes. Drain any excess fat if necessary. 
- Add the crushed tomatoes, tomato sauce, and tomato paste to the beef mixture. Stir well to combine. Sprinkle in the sugar, dried basil, oregano, salt, and pepper. Reduce heat to low and let simmer gently for 15 to 20 minutes, stirring occasionally. 
- Preheat the oven to 350°F (175°C). Lightly grease the baking dish with cooking spray or oil. 
- Add the cooked spaghetti to the skillet with the sauce and toss gently to coat evenly. 
- Spread half of the saucy spaghetti in the bottom of the prepared baking dish. Dollop half the ricotta cheese over it. Sprinkle with one cup of shredded mozzarella and a quarter cup of Parmesan cheese. Repeat layers with remaining spaghetti, ricotta, mozzarella, and Parmesan. 
- Bake uncovered for 25 to 30 minutes until cheese is melted, bubbly, and slightly golden on top. 
- Remove from oven and let rest for 5 minutes. Sprinkle chopped fresh parsley over the top. Serve hot and enjoy!