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 lighsaber:
The lightsaber was considered more a tool than a weapon. The lightsaber came to fulfill both a symbolic and pragmatic role for the Jedi; it identified the wielder, had a powerful visual impact, and given the availability of cybernetic replacement limbs might have been seen as a more 'clean' weapon than the blaster, which Obi-Wan regarded as "uncivilized," "clumsy" and "random."
(Source)