Preheat oven to 400°F. Coat a 9-by-13-inch baking dish with cooking spray.
Combine squash, onion, chiles, jalapenos, salt and 3/4 cup cheese in a large bowl. Sprinkle with flour; toss to coat. Spread the mixture in the prepared baking dish and cover with foil.
Bake the casserole until it is bubbling and the squash is tender, 35 to 45 minutes. Spoon salsa over the casserole and sprinkle with the remaining 1 1/2 cups cheese. Bake, uncovered, until golden and heated through, 20 to 30 minutes. Sprinkle with scallions and red onion.