In countries with UHC it makes no sense, really. Spain doesn’t have separate hospitals for veterans and very few ones for active personnel. With I think two exceptions, permanent military “hospitals” are more like day centers, if a soldier needs surgery he’ll get shuffled to the nearest civilian hospitals (those two exceptions I know of happen to be the biggest local hospital, so they actually get a lot more civilian patients than military ones).
The Spanish Armed Forces provide training in fields which may be difficult to get into otherwise; they may also provide “normal” training in unusual ways. For example, a former boss of mine had obtained all his training in business management and chemistry as a demolitions sergeant. He wasn’t the kind of guy who’ll do good in a classroom, but he evidently hadn’t had much of a problem picking up the training so long as it came on the job.
They’ve got no shortage of people asking for information about joining, some of the big motivators are being able to do stuff you just don’t get to do in civilian life, being able to get training in things for which civilian training would be ridiculously expensive (the typical example is plane pilot) and the job security. The Academies are considered quite difficult to get into, but then, they had entrance tests when nobody else did and the tests include both physical and “class knowledge” parts. There are some companies which prefer to hire people with military experience and the military knows which ones they are, so they will funnel people there.
Also, many of our Civil Service examinations give “points” for previous service, which includes military service among others.