Preheat the oven to 350°F (175°C) and spray a 9x13-inch baking dish with cooking spray.
Break the 8 ounces of spaghetti in half and cook in a large pot of boiling salted water according to package directions until al dente; drain well.
In a large mixing bowl, whisk together 2 cups shredded Monterey Jack, 1/2 cup of the shredded Parmesan (reserve the rest), 1 cup sour cream, 1/2 cup ricotta, 1 large egg, 1 teaspoon salt, 1/2 teaspoon pepper, and 1 teaspoon garlic powder until smooth.
Fold the drained 10 ounces chopped spinach, about 3 ounces of the crispy fried onions, and the cooked spaghetti into the cheese mixture until evenly combined.
Transfer the mixture to the prepared baking dish, cover with foil, and bake for 30 minutes.
Remove the foil, sprinkle the remaining crispy fried onions and the reserved Parmesan on top, and bake uncovered 5–8 minutes more until the top is golden and crispy.
Let the casserole rest at least 5 minutes before serving.