The most they could have given you for that is a small fine. Spain is a very civilized country with laws similar to the ones in every other european country. There is nothing to worry about
I can give you one piece of advice about Spain. DON'T under ANY circumstances give the doormen at bars in the turist areas a reason to harm you, because they will!! My own personal experience has been that the police closes their eyes in this particular situation.