Preheat the oven to 350 degrees F (175 degrees C). Grease a 9x13-inch baking dish with cooking spray.
Beat eggs, onion, and flour in a mixing bowl until flour is no longer lumpy. Stir in spinach, cottage cheese, Cheddar cheese, butter, salt, and pepper until evenly combined; pour into the prepared dish.
Bake casserole in the preheated oven until bubbly and golden brown, about 45 minutes.
