Heat olive oil in a large skillet or saucepan over medium heat.
Add chopped onions, garlic, carrot, and celery. Sauté until softened, about 5 minutes.
Add ground meat and cook until browned, breaking it into small pieces.
Stir in tomato paste, canned tomatoes, and red wine (if using).
Add dried oregano, basil, bay leaf, salt, and pepper. Pour in stock.
Simmer uncovered on low heat for 30-40 minutes, stirring occasionally until thickened. Remove bay leaf before serving.
Meanwhile, cook spaghetti in salted boiling water according to package instructions. Drain and set aside.
Combine spaghetti with sauce or serve sauce on top. Sprinkle with Parmesan cheese and garnish with fresh basil.