I thought it was because measles was a childhood illness and very serious for adults to get. Plus it was easier for the parents if they could plan around the infection and didn’t have to worry about the kids getting it again.
I don’t recall anything about building the immune system in those days.
Any kid who had measles, mumps, etc always had a party with kids in the neighborhood, also cousins etc to build up the immune systems. Moms weren’t making us wash our hands every 10 minutes, no “sanitizing” shopping carts, and if we dropped food on the floor or outside on the ground we “kissed it up to God” and ate it.