Again on paper there is very little reason not to use ranged most of the time, but in practice I see plenty of melee characters. Players find them fun, its as simple as that.
Eldritch Knights and Bladesingers will do more damage on a melee build than a ranged build and these are among the highest damage martials without expending limited resources.