Asgardians had the technology for projectile weapons.
Adgardians had good cause to have projectile weapons (Dark Elves, Chitauri, etc.).
Their swords were inferior to projectile weapons. (Based on the fact that a highly trained army of demigods using swords got absolutely slaughtered on their own turf by an enemy they outnumbered.)
It must then be the case then that they did not want to use such weapons, at least for personal combat.
Asgardians live and die by honor. To Asgardians, swords are more honorable (ethical) than guns.
A human analogy might be hollow-point bullets, which have been prohibited for use in war as far back as the Hague Convention of 1899. Hollow-points are very effective at causing pain and death, and they would make war far more painful for your opponent. They are in the technical sense better, yet most nations adhere to this ban, and many (most?) people agree they are "more unethical" to use in war.
Asgardians, like humans, deliberately chose not to use technically superior weapons.
EDIT: I don't mean to say that the Asgardians signed some sort of wartime accords. I mean that people often choose inferior weapon out of honor/ethics. Humans do it to honor treaties. Asgardians do it because out of honor to traditions, the ideal warrior, etc.