According to my dictionary, an aileron assists in balance on an aircraft and a spoiler reduces lift and assists in assent. A spoiler is a similar device on a car. I and, I suspect, most people would associate aerilons with aircraft and spoilers with cars. You can't have an aerilon on a car. Although (because?) I'm not a technical person, they seem to me to have different, although perhaps similar, functions. With cars, we just say spoiler and not rear spoiler.
Merriam-Webster says that an aileron is "a movable airfoil at the trailing edge of an airplane wing that is used for imparting a rolling motion especially in banking for turns," and a spoiler is "a movable airfoil at the trailing edge of an airplane wing that is used for imparting a rolling motion especially in banking for turns." Both are shown in their picture of an airplane.
They also define spoiler as "an air deflector on an automobile to reduce the tendency to lift off the road at high speeds."
You also need to understand the concept of an airfoil in which air is directed over a curved surface to create lift. All of this is part of fluid dynamics.
Now back to the real world. There are times that you want things to fly, i.e. lift off the ground and times that you don't.
When an aircraft lands, you want that aircraft to stick to the ground. Thus, engineers have developed spoilers that rise from the top surface of the wing and disrupt the airflow and destroy the lifting effect of the airfoil. (Spoilers also crate more aerodynamic drag, but that's not part of the name)
Similarly, a high-speed automobile should stick to the ground, but if you look at the shape of an automobile in cross-section, you will see that it resembles the cross-section of an airfoil, such as an aircraft wing.
If you are driving at high speed, you do not want the back end of the automobile lifting off the ground, so, sometimes, "spoilers" are used to disrupt what engineers call the "laminar airflow.'
Race cars often have a upside-down "wing" on the back and front in which the airfoil does not disrupt the airflow, but actually "flies" the vehicle toward the ground in order to maintain/increase traction.
None of this has anything to do with cosmetics, however, in which many automobiles have a useless "thingy" on the back that salesmen and other marketing types call a "spoiler" in order to create a misguided image of power and speed related to racing.
Cast a critical eye at the vehicles on the road and see how many (such as the '96 Toyota Camry, we had) with front-wheel drive and a fake "spoiler" on the back, i.e. the non-driving axle.
If you check the etymology of aileron, you will see that it means "little wing," which is true in aircraft, since the ailerons are part of the larger wing. Whether this is logical in Spanish automotive use would depend upon whether it's actually a wing that "flies" the driving axle toward the ground or whether it's the aforementioned useless thingy used for cosmetic purposes. It has nothing to do with "spoiling" the laminar airflow of an airfoil.
Popular language regarding technical concepts is often illogical since the knowledgeable are usually vastly outnumbered by the clueless.