I understand that you need to ensure, if you are in a community, that there are no statutes, which prohibit letting.
Then you need to ensure that the property is ‘designated’ for letting under planning regs (or similar) some properties are not.
Then you need the Regional approval.
Then you will need to declare the income, maybe charge IVA, and if you do, then make several IVA tax returns very year.
I also understand that you will need safety certificates for each new let, electric and gas.
Then you may get a tenant who damages the property, is a problem to the neighbours, does not pay the rent etc.
And there may be more.
That said, I believe from observation and experience that most people let illegally, even agents.
But even that has increasingly potential problems. As there is a story (maybe be true or not) that the utility services providers must supply details of usage to the Hacienda. If they do that then it is apparent that an ‘empty’ property is being let !!
Good Luck !!
PS I gave up renting years ago,