I think you are right, I guess the initial question about the best country to trade in, could expand to a few cases where you would choose between a limited company and an individual. That would include better places than Spain for sure.
I found this report from the CNMV, the Spanish authority that goes into more detail.
https://www.cnmv.es/DocPortal/Publicaciones/Guias/Guia_Fiscalidad_Acciones.pdf
The page that goes into detail:
View attachment 294774
Which goes to what LuisHK was pointing out. There are a few more levels to consider.