Heat 2 tablespoons olive oil in a large skillet over medium heat. Add the diced onion and chopped scallions and sauté until soft and lightly browned, about 5 minutes.
Add the spinach to the skillet in batches, stirring until wilted and limp, about 5 minutes total; season with 1/4 teaspoon salt.
Transfer the cooked spinach mixture to a fine-mesh colander and press or squeeze out as much liquid as possible using a large spoon; let cool for about 15 minutes.
Preheat the oven to 325°F (165°C).
In a large bowl, combine the squeezed spinach, ricotta, crumbled feta, chopped dill, and eggs; mix until evenly combined.
Brush a 9×11-inch baking dish with olive oil. Lay one sheet of phyllo dough in the dish, letting it hang over the edges, and brush lightly with olive oil. Repeat with 7 more sheets to create eight bottom layers.
Pour the spinach-and-cheese filling into the prepared phyllo-lined dish and spread it into an even layer.
Top the filling with the remaining 8 phyllo sheets, brushing each sheet lightly with olive oil as you layer. Fold any overhanging edges in and brush the top with a little more oil.
Bake the spanakopita in the preheated oven for about 40 minutes, until the phyllo is golden brown and crisp.
Remove from the oven and let rest a few minutes before slicing and serving.