Metric spaces were introduced by Frechet in his PhD dissertation on functional analysis, in 1906. Functional analysis (and rigorous modern analysis) was still quite new at the time. Also, an abstract, axiomatic, approach to mathematics was also not yet as routine as it is for us today. The mathematicians of that time were studying various spaces (mainly spaces of functions) and they had various notions of convergence in such spaces. But everything was ad-hoc. For each space its own notion(s) of convergence was introduced, and studied. Of course, similarities were noticed (i.e., uniqueness of limits was a common trend etc.). There was a dire need to simplify things and unify arguments. Frechet's genius was to do just that by axiomatizing the notion of distance and show that many of these spaces were instances of metric spaces. Then, by proving one result axiomatically from the metric axioms, it automatically holds for all instances.
This was the historical motivation. In the modern view, the concept of a metric space is just an axiomatization of the notion of distance. It is among the more straightforward axiomatizations, especially to modern students who see axiomatic systems early on. The notion of distance is very important since, for instance, it is used in the definition of limit. Many geometric notions rely on a notion of distance (e.g., circles). So, it is natural to distill some common properties of distances in various contexts and set them as axioms. Voila - metric spaces.
Just as a side note: There is quite a lot of flexibility in the axioms of metric space. Neglecting any of them (giving rise to things like semimetric, quasimetric spaces etc.) give interesting spaces as well with somewhat similar theory as metric spaces exhibit. One crucial difference though is that if the symmetry axiom is neglected (quasimetric spaces then), then the general theory is quite difference (in particular, there are then many different completions).