Different kinds of gunpowder weapons have been in use, specifically in Europe, since the 14th century so I am going to assume you mean after the introduction of massed musketry in the 17th-18th centuries. Before the introduction of the bayonet, most soldiers relied upon the column or pike square formation because of the melee potential of the pike, which could fend off infantry but especially cavalry - something arquebusiers and early musketeers were especially vulnerable to. Once the bayonet was invented musketeers were essentially self-reliant as an infantry arm - they still required artillery and cavalry to support them but gunpowder units could now fulfill the melee and defense against cavalry role quite effectively.
Now the column is not quite the same as the square, which was an essentially static unit utilized for its resistance to cavalry - see Wellington's Squares at Waterloo or Napoleon's use of them at the Battle of the Pyramids. The column was usually a very offensive formation, intended to create an unstoppable weight and momentum of movement that could carry away enemy lines. As you point out, columns lacked the firepower capabilities of other formations such as line or even square, but they had the added advantage of not requiring a massive amount of training and boosted morale for those moving forward - a massive reason behind the French victory at Valmy was sheer enthusiasm, boosted by their columnar formations that carried their weight to the Allied line too quickly to be shot down. It's crucial to understand that until the introduction of breech loading rifles, melee assaults were usually the primary means of carrying a position or forcing an enemy to retreat - the famous Russian general Suvarov was quoted as saying "The bullet is a mad thing; only the bayonet knows what it is about." Now the British demonstrated the effect that well-trained men in a thin line-type formation could have on an enemy advancing in column, repeatedly defeating such formations in the Peninsular war in Spain. But many of Napoleon's successes relied upon the use of heavier and more dense formations, and this shows their effectiveness - especially against lesser trained troops without the same rate of fire as better practiced units. These 'mass' tactics also allowed troops to be trained and utilized effectively with only a modicum of training, which helped mobilize the populace for the war effort in a faster manner.
As for why columnar tactics were used after the invention of breech loading weaponry? Essentially Europeans and Americans were brought up with the traditions of the Napoleonic Era and before, and believed that these lessons held true. Thus the Americans in the Civil War and the Europeans in the Franco-Prussian war and onwards continued to utilize these tactics despite their obvious technological disadvantage. In WWI most sides continued to utilize mass charges, at least for the starting months, and with disastrous effects. It was the lessons learned in the trenches, where machine gun fire and artillery barrages were capable of wiping out entire columns with ease, that finally broke the majority of supports of such outdated tactics.
For sources I would suggest the following.
Townsend, Charles. The Oxford History of Modern War Oxford: Oxford University Press, 2000.
Parker Geoffrey, The Military Revolution and the rise of the West
"The Campaigns of Napoleon" by David G. Chandler, Scribner, 1973
Ross, Stephen (1979). From Flintlock to Rifle: Infantry Tactics, 1740-1866.
Hastings, Max. Catastrophe, Europe Goes to War 1914