In a large cast iron pan, heat the olive oil. Sauté the onions and mushrooms for 10 minutes or so, until browned and caramelized.
Add the crumbled tempeh, garlic, fennel seeds, red pepper flakes, soy sauce, and balsamic vinegar. Sauté for a few more minutes until the tempeh starts to stick to the pan. Stir in the wine (if using) towards the end or substitute for water or broth.
Add the crushed tomatoes and tomato paste.
Simmer for a few minutes. Stir in 1/4 cup of water or broth to thin.
Serve atop the spaghetti squash.