I see no reason to be upset about this situation. Rather you should be totally happy that the Port Police allowed you to leave without fining you. The rules are pretty clear and it would be nearly impossible to believe you didn't know them. How could you clear out of
spain, then
head to the Balearic Islands? How could you go from the Balearic Islands to Sardinia and think you needed to clear in? Why would the PP think you had been in a Shengren area for over 180 days? Just because of a stamps shape? Doubtful. It was probably because you had been.
The rules are a PITA no doubt. But either follow them or don't complain when you are caught.