I have a feeling this has been answered before, but basically it is because H and He dominate the elemental abundances in the universe. When we look at what else there is we are guided by the elements we can ascertain are present in the photospheres of stars. It just so happens that the most prominent signatures (the Fraunhofer absorption lines) are those due to atomic and ionic absorption features due to calcium, iron, sodium, magnesium, nickel and aluminium - i.e. "metals".
This is ironic(!), because actually, after H and He, the most abundant elements in the universe are oxygen, nitrogen and carbon (i.e. non-metals); but their signatures in the optical spectrum of stars are comparatively weak. As a result, astronomers lazily refer to anything heavier than helium as "metals" and there is little motivation to change this nomenclature since there is an orders of magnitude gap between the abundance of helium and the abundance of the C, N, O etc. in the universe.
In recent times the term "metals", or "metallicity" has become less useful, because it has been found that the abundance of the heavier elements do not all scale in the same way. Some stars are comparatively rich in O, Mg, Si (the so-called "alpha elements" that are formed by the capture of He nuclei), or in s- or r-process elements that are formed by neutron capture, or have other abundance peciuliarities in one or more elements. For example, older stars born within a billion years of the formation of our Galaxy tend to have a higher $\alpha$-element/Fe ratio than stars being born today, even though their iron abundance is very low. It has become far more important to say exactly what you mean by "metallicity" and I would say the default now is to assume that, in the absence of any other stated definition, "metallicity" refers to the relative abundance of iron-peak elements (Mn, Fe, Ni, Co).