Preheat oven to 350 degrees F (175 degrees C). Grease a deep 9x13 inch baking dish.
Bring a large pot of salted water to a boil over high heat. Stir in the spaghetti. Boil the pasta until cooked through but still firm to the bite, 8 to 10 minutes. Drain well.
Brown ground beef and onion in a large skillet over high heat; drain fat. Stir in the spaghetti sauce, sour cream, and 1 cup of the mozzarella. Mix in the cooked pasta. Transfer pasta mixture to prepared baking dish. Top with remaining 1 cup of mozzarella and the Parmesan cheese. Cover pan with aluminum foil.
Bake in preheated oven until hot and bubbly, about 30 minutes.