All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, Peace and Blessings of Allah be upon him, is His slave and Messenger.
Protection of life is a key objective (Maqsad) of Sharia, so it isn`t permissible to transgress against it no matter what the case maybe. Islam has legislated laws that ensure preserving this objective, so it forbade killing and whatever leads to it. This is attested to in the following verse, it reads (What means): "If a man kills a believer intentionally, his recompense is Hell, to abide therein (For ever): And the wrath and the curse of God are upon him, and a dreadful penalty is prepared for him." [An-Nisa`/93]. In addition, the Messenger of Allah (PBUH) said: "The blood, honour and property of a Muslim is inviolable for another Muslim." [Moslim].
Amongst the means, that preserve life is banning firing guns during different occasions and celebrations as well as considering this act impermissible for the following reasons:
1. Harming and intimidating Muslims since many incidents took place unintentionally where fired shots killed many people and injured many others. The Hadith in which the Prophet (PBUH) said (What means) supports this, it states: "It is not lawful for a Muslim that he frightens a Muslim. [Related by Abo Dawood]. When somebody is killed by these shots, the person who fired them is considered a reckless person who doesn`t care for the lives of others and who has committed what is considered unlawful in Sharia. Therefore, this person must pay Diya [Blood money] and offer Kafarah (expiation), which is fasting two consecutive months. Allah The Almighty Says (What means): "Never should a believer kill a believer; but (If it so happens) by mistake, (Compensation is due): If one (so) kills a believer, it is ordained that he should free a believing slave, and pay compensation to the deceased’s family." [An-Nisa`/92]. Moreover, a discretionary penalty is decided by the judge to make an example of such person.
The Prophet (PBUH) forbade carrying a weapon out of its sheath in order not to cause harm to Muslims accidently or to point it toward a fellow Muslim for the purpose that the cursed Satan may make the former's weapon lose from his hand. So how would be the result when a person uses his weapon and harms Muslims?! The Prophet (PBUH) said: "If anyone of you passed through our mosque or through our market while carrying arrows, he should hold the iron heads," or said: "... he should hold (their heads) firmly with his hand lest he should injure one of the Muslims with it." [Moslim].
2. Sharia has granted the Wali Al-Amr (Those in the position of authority) the right to make laws that help preserve law and order to ensure protecting life and wealth and in compliance with the provisions of Sharia. Consequently, laws banned firing off guns by individuals not permitted to do so and incriminated such an act, be that during occasions or not.
3. It is considered spoiling of one's wealth since Allah, The Most Exalted forbade this where He Said (What means): "Lo! the squanderers were ever brothers of the devils, and the devil was ever an ingrate to his Lord. [Al-Isra'/27].
4. The ammunition in general is allocated to defend religion, country and fellow citizens; therefore, using it for a reason other than the one for which it was manufactured in the first place is impermissible i.e. using the grace of Allah for a reason other than that for which it was created is being ungrateful to Allah's grace.
In conclusion, it isn`t allowed to fire guns into the air, violate the instructions of Wali Al-Amr, intimidate and harm others, and waste money unrightfully. And Allah The Almighty Knows Best.