Preheat the oven to 450°. On a foil-lined baking sheet, toss the beets with 1 tablespoon olive oil; season with salt and pepper. Wrap tightly with foil and roast for 15 minutes. Unwrap, then arrange the beets in a single layer. In a small bowl, toss the onion with 1 tablespoon olive oil and season with salt and pepper; arrange on the baking sheet. Roast, tossing halfway through, until tender, 8 to 10 minutes.
Meanwhile, bring a large pot of salted water to a boil. Add the rigatoni and cook until al dente. Drain, reserving 1/2 cup pasta cooking water. Return the pasta to the pot and toss with the spinach.
In a bowl, whisk the ricotta, reserved pasta water, lemon peel, lemon juice and the remaining 1 tablespoon olive oil. Add to the pasta along with the vegetables. Season with salt and pepper; toss.