This definition has a historical origin, as these names have been given in the $18$th and $19$th century.
In the $18$th and $19$th century, oxides and hydroxides were not always separated. Hydroxides were often considered as hydrated oxides, like salts were known sometimes as anhydrous and sometimes hydrated. Metallic oxides and hydroxides were not considered really different.
In these old times, the oxides (or hydroxides) were known and studied before the elements were discovered. So first alkaline oxides (or hydroxides) were found to be very soluble and strongly alkaline. Then earths were similar to alumina (aluminum oxide) which is insoluble in water and neither basic nor acidic. But aluminum oxide (or hydroxide) neutralizes acids somewhat like an alkaline hydroxide. So there is a common character to alkaline hydroxides and earths : the reaction with acids, making salts.
Well, now, chalk, magnesia and baryta (oxides or hydroxides) are half way between alkaline hydroxides and earths : they are a little soluble, and this behavior is between soluble alkaline hydroxide and insoluble earths. Furthermore, chalk, magnesia and baryta react with acids like alkaline hydroxide and earths. So these oxides and hydroxides are intermediate between alkaline compounds and earths. This is why they are called "alkaline earths". Later on, the same name have been given to the metal, when the corresponding metal has been produced, usually by electrolysis.