I don't think this is unreasonable tbh, in the context of Spanish weddings, which are quite different to UK weddings in many ways.
@MumOfHals which part of Spain, what time of year, and what time of day? Will the other guests be Spanish?
As a rule weddings in Spain are extremely formal - think dressing for a gala more than dressing for a garden party - and if you have selected a formal venue I understand where you're coming from. Having said that, British guests who are not used to Spanish weather or dress codes might not know this or understand, so it's a bit delicate. Agree with PP you could put "formal - no black tie" or similar on the invitations as most people will know what this means and select chinos etc. Your guests will have spent money and probably taken annual leave to attend, so you want to make them feel welcome, while giving them enough information to know what to expect. Because on the flip side I'm not sure anyone would want to be "that one person" who turns up wearing shorts at 7pm when everyone else is in jackets and long trousers, and still eating outside at gone midnight!
Most Spanish weddings I've been to start late, ceremony at 7.30pm for example with dinner at 10pm (I've been to one with dinner starting at midnight :-O), which is specifically to avoid the killer afternoon heat. By the time you go home at 3am it can be quite chilly! My (Spanish) husband always wears his full suit including jacket, leather shoes and tie on properly for the ceremony, no matter the temp, and his family and friends (as far as I have seen) do the same, as a mark of respect for the occasion. These days I've noticed many men wearing braces and bow ties without a jacket. I've yet to see anyone wear shorts, ever. I think this is one of those rare situations where women draw the long straw in life😆
I also think that on the day you probably won't even notice what other people wear, let alone let it bother you :)
One thing- if you are expecting it to be very hot, consider providing fans as gifts for guests as they arrive. The guests, particularly those not used to hot weather, will thank you for it! And they can keep them as a reminder and use them in UK heatwaves ;-)