Preheat oven to 350 degrees F.
Cook spaghetti according to the directions on the package, then drain.
In a large mixing bowl add the sour cream, egg, garlic and onion powder. Whisk together.
Add the spaghetti, chicken, cheese and spinach and stir together.
Spray a casserole dish with non-stick cooking spray and add the ingredients to it. Sprinkle with the onions and cover tightly with foil.
Bake for 20 minutes, then remove the foil and cook an additional 5 minutes.