Put the damp spinach in a large saucepan and cook over high heat until wilted, about 3 minutes. Transfer the spinach to a strainer and drain. In a food processor, combine the spinach with the mascarpone, 1 tablespoon of the heavy cream and 1 garlic clove and puree for 30 seconds. Transfer the spinach mixture to a bowl and season with salt and pepper.
Wipe out the bowl of the food processor. Add the onion quarters and 2 more garlic cloves and process until finely chopped. Add the whole egg and the rosemary and process for 30 seconds longer. Add the ground beef and 1/4 cup of the Parmigiano. Season the meatball mixture with salt and pepper and process until blended.
In a large skillet, cook the remaining 1 garlic clove in 1 tablespoon of the olive oil over moderately high heat until the garlic begins to sizzle. Drop rounded teaspoons of the meat mixture into the pan and cook until sizzling, shaking the pan for even browning. Add the wine and the remaining 2 tablespoons of cream and cook for 3 minutes longer, stirring gently. Reduce the heat to low and add the spinach puree. Cover and cook until the sauce thickens slightly, about 10 minutes. In a bowl, beat the egg yolks with the remaining 2 tablespoons of Parmigiano and 2 tablespoons of olive oil and season with pepper.
Meanwhile, in a large pot of boiling salted water, cook the pasta until al dente, then drain and transfer to a bowl. Toss the pasta with the egg yolk mixture, the green sauce and the meatballs and serve immediately.