Bring a large pot of lightly salted water to a boil. Cook pasta in boiling water until al dente; drain.
Meanwhile, heat olive oil in a large skillet over medium-high heat; add onion and garlic, and cook until golden brown. Mix in tomatoes, mushrooms, and spinach. Season with salt, pepper, and red pepper flakes. Cook 2 minutes more, until tomatoes are heated through and spinach is wilted. Reduce heat to medium, stir in pasta and feta cheese, and cook until heated through.