Heat oven to 400F. Rub beets with oil and season with salt and pepper. Place beets in a baking dish, cover with foil and roast until tender; let cool to handle. Rub off skins of beets and chop into small, bite-sized pieces.
Bring large pot of water to a boil for the pasta. Salt water and add spaghetti; boil 5 minutes and drain. Return pot to stove, add wine and reduce over high heat for 2-3 minutes. Once boiling, dump the pasta back into the pot and cook over medium-high heat until most of the liquid evaporates, tossing frequently with tongs. Add beet greens when pasta is just al dente.
Meanwhile, in a skillet, heat 3 turns of the pan olive oil over medium-high heat. Add shallots or onions, garlic, salt and pepper; cook to tender 7-10 minutes. Sprinkle with sugar and add the vinegar and some of the wine sauce to deglaze. Scrape veggies into the pot to combine with pasta.
Toss with beets and parsley, and serve, garnished with ricotta salata.