Certain posters have indeed tried to enlighten you with their experiences. But even in similar circumstances you might well have a different experience.
"I decided to put border control to a tough test and we had heated discussions for about one hour "
You can believe your understanding of the rules is better than it was for border control staff, but the border control staff have the authority and discretion to seek additional documents if they think it is necessary.
Your "heated discussions" would have made the officer even more suspicious.
It seems to me that your national EU ID is not Spanish. You arrived in Spain from a non-EU country. One would expect some extra vigilance by EU border staff for such arrivals.
It is not a good idea to have "heated discussions" for an hour in such a situation. One ends up making a fool of oneself - having had to show your British passport in the end!!!!!!!!!!
Myself and others criticising your behaviour are actually taking the time to try and enlighten you on how not to waste other people's valuable time for a trivial matter on a "very infrequent" visit when you could just have shown your British passport and passed through in a couple of minutes.
The staff are paid to do their work, not to spend an hour to help you boost your ego while frustrated travellers waited behind.
It was certainly not an interesting experience and food for thought for either the immigration officer or for the travellers waiting behind.
Out of curiosity, what did the border staff say to you when you finally showed him/her your British passport?