Preheat the oven to 375 degrees F (190 degrees C).
Bring a large pot of lightly salted water to a boil; add penne and cook, stirring occasionally, until tender yet firm to the bite, about 11 minutes. Drain.
Heat olive oil in a skillet over medium-high heat. Sauté onion in hot oil until tender, 5 to 7 minutes.
Mix penne pasta, onion, chicken, diced tomatoes, spinach, and cream cheese together in a baking dish until the cream cheese melts and coats everything. Sprinkle mozzarella cheese over the pasta mixture. Cover baking dish with aluminum foil.
Bake in the preheated oven for 30 minutes. Remove foil and continue baking until heated through and beginning to brown along the edges, about 15 minutes more.