Cook the spaghetti in salted water according to package directions. Reserve ½ cup pasta water before draining.
While the pasta cooks, heat olive oil in a large skillet over medium heat. Sauté onion and garlic until soft, about 3–4 minutes.
Add the ground beef and cook until no longer pink. Drain excess grease.
Stir in crushed tomatoes, oregano, salt, and pepper. Simmer for 15–20 minutes, stirring occasionally.
Add cooked spaghetti to the sauce and toss to combine, using reserved pasta water as needed to loosen the sauce.
Serve hot, topped with basil and Parmesan if desired.