Preheat your oven to 375°F.
Cook the penne pasta according to package instructions until al dente. Drain and set aside.
In a large skillet, heat the olive oil over medium heat. Add the chopped onion and sauté for about 5 minutes until translucent.
Stir in the minced garlic and cook for an additional minute.
Add the chopped spinach and cook until wilted (if using fresh) or heated through (if using frozen). Remove from heat.
In a large bowl, combine the ricotta cheese, half of the mozzarella cheese, half of the Parmesan cheese, egg, oregano, salt, and black pepper. Mix until well combined.
Add the cooked pasta and the spinach mixture to the cheese mixture. Stir until everything is evenly coated.
Spread half of the marinara sauce on the bottom of a 9x13 inch baking dish.
Pour the pasta mixture over the sauce and spread evenly.
Top with the remaining marinara sauce and sprinkle with the remaining mozzarella and Parmesan cheeses.
Cover the baking dish with aluminum foil and bake for 25 minutes.
Remove the foil and bake for an additional 15 minutes, or until the cheese is bubbly and golden.
Let the pasta bake cool for about 5 minutes before serving.