its because the flower did not get polinated. in order for the squash to grow to maturity the flower has to be polinated. remember the plant only knows survival. it thinks its only purpose is to reproduce and provide seed in order to keep going in this world.
if bees do not polinate the flower the seeds inside the growing squash are sterile so the plant aborts the squash conserving its energy for a polinated flower.
with the shortage of honey bees you can polinate them yourself, just take a small paint brush or q-tip, swab it around inside one flower move to the next and swab it around as if you were a bee going from flower to flower.
i had birdhouse gourds that i had to do the same thing to, with these there is a male flower and a female flower so i took the male flower, pealed away the petals and swabbed the flower inside the female and wha-la! i had full size gourds!