Though scandium and yttrium have lower atomic mass, they fall in the category of HREEs. The classification seems to have something to do with the formation of REE ores. Here is an extract of Wikipedia describing this phenomenon.
REE are chemically very similar and have always been difficult to separate, but a gradual decrease in ionic radius from LREE to HREE, called lanthanide contraction, can produce a broad separation between light and heavy REE. The larger ionic radii of LREE make them generally more incompatible than HREE in rock-forming minerals, and will partition more strongly into a melt phase, while HREE may prefer to remain in the crystalline residue, particularly if it contains HREE-compatible minerals like garnet. The result is that all magma formed from partial melting will always have greater concentrations of LREE than HREE, and individual minerals may be dominated by either HREE or LREE, depending on which range of ionic radii best fits the crystal lattice.
The original reference is included below:
References
Winter, John D. (2010). Principles of igneous and metamorphic petrology (2nd ed.). New York: Prentice Hall. ISBN 9780321592576. OCLC 262694332.
Jébrak, Michel; Marcoux, Eric; Laithier, Michelle; Skipwith, Patrick (2014). Geology of mineral resources (2nd ed.). St. John's, NL: Geological Association of Canada.