Bring a large pot of lightly salted water to a boil. Cook spaghetti in the boiling water, stirring occasionally, until cooked through but firm to the bite, about 12 minutes; drain.
Toss spaghetti with some of the Parmesan cheese and butter in a large bowl.
Layer about 1/3 of the spaghetti in the bottom of a 9x13-inch baking dish. Top with layers of sour cream and spaghetti sauce. Repeat layering until ingredients are all included. Top with mozzarella cheese and remaining Parmesan cheese and butter.
Bake in preheated oven until top is bubbling and browning on the edges, about 30 minutes.