Heat oven to 375°F. Spread 1 cup marinara over the bottom of a 9×13-inch baking dish.
Boil shells in well-salted water until just shy of al dente. Drain and cool slightly on a sheet pan.
Stir together ricotta, 1.5 cups mozzarella, 1/2 cup Parmesan, spinach, olive oil, garlic, Italian seasoning, red pepper, 1 tsp salt, and black pepper.
Stuff each shell with about 2 tablespoons filling and nestle into the sauced baking dish.
Spoon remaining marinara over shells. Drizzle pesto in thin ribbons for a red-and-green finish.
Top with remaining mozzarella and Parmesan. Cover tightly with foil.
Bake 20 minutes. Uncover and bake 8–10 minutes more until bubbling and lightly browned. Broil 1–2 minutes if desired.
Rest 5 minutes. Scatter fresh basil over the top and serve warm.