Preheat the oven to 190°C (375°F) and position a rack in the middle of the oven.
Bring a large pot of lightly salted water to a boil and cook the pasta shells until al dente, about 5 minutes; drain and pat dry on kitchen paper or a clean towel.
Heat 1 tablespoon olive oil in a skillet over medium heat. Add the chopped onion and garlic and cook until softened and translucent, about 1–2 minutes.
Add the spinach to the skillet, cover, and cook for about 4 minutes, stirring occasionally, until wilted; season with a pinch of nutmeg and salt and pepper to taste. Remove from heat and let cool slightly.
Transfer the cooked spinach to a chopping board and finely chop. In a mixing bowl, combine the chopped spinach, drained ricotta, chopped basil, and salt and pepper until evenly mixed. Transfer the mixture to a piping bag or prepare to spoon it into the shells; refrigerate briefly if needed to firm up.
Drizzle a little olive oil in the base of a large oven-proof casserole dish and spread 400 g of tomato sauce over the bottom.
Stuff each pasta shell generously with the ricotta-spinach filling and arrange the shells in the baking dish over the sauce. Pour any leftover tomato sauce over the shells and drizzle a little olive oil on top.
Cover the dish with aluminium foil and bake for 2 minutes. Remove the foil, sprinkle the grated Parmesan over the shells, and broil or bake briefly until the cheese is melted and lightly browned.
Remove from the oven and serve immediately.