Because guns are crude!
In Episode III: Revenge of the Sith after defeating Grievous with a blaster, Obi Wan that blasters are 'So uncivilised'.
Wookieepedia explains that these weapons were:
Designed as much for elegance in combat as for ceremony
If we look at the origins of the lightsaber, they started out as forcesabers through which:
Users [could] channel the dark side of the Force through black laboratory-grown crystals which would create the glowing energy blades
There is also a great symbolic and functional value attached with a lighsaberlightsaber:
The lightsaber was considered more a tool than a weapon. The lightsaber lightsaber came to fulfill both a symbolic and pragmatic role for the Jedi; Jedi; it identified the wielder, had a powerful visual impact, and given given the availability of cybernetic replacement limbs might have been seen seen as a more 'clean' weapon than the blaster, which Obi-Wan regarded as as "uncivilized," "clumsy" and "random."
(Source)