This is like asking why a battered wife doesn't defend herself against her abusive husband.
The Russian military is much larger than the Ukrainian military, and the Ukrainians knew they didn't stand a chance in any conflict. Additionally, having a tumultuous change of government at the same time which paralyzed decision making didn't help. The Russians, on the other hand, had been preparing for this for weeks, moving additional troops into the Crimea before the opportunity presented itself. It didn't help that Ukrainian military equipment is antiquate soviet holdovers, with very little equipment upgrades in the last 25 years.
On top of it, the majority of the Ukrainian navy was in the Crimea, which enabled the Russians to easily bottle it up. Ukrainian policy allowed servicemen to be based near their hometowns - which would have made the army more pliable to local pressures. Finally, the Ukrainians also have to worry about the Russian-speaking eastern part of the country separating at the moment.
There was very little the Ukrainians could do, and shooting back would have been a pointless loss of lives and only provided an excuse for Putin for even further aggression.