If cops fired warning shots into the air what would happen when those shots came crashing back down to earth? If you shoot into the air, the bullet will come back down and strike randomly anywhere. This is one of the un-safest things anyone with a firearm can do.
And please don't say to shoot at the ground or something else. Bullets can and will ricochet when you do that.
Imagine the uproar when a bullet fired by police into the air comes down and hits some random person crossing the street. But at least the person stabbing people with a knife would still be safe...