I don't think in most cases, the U.S. even records when U.S. citizens leave the country. I can't recall an outbound international flight during which I had to pass through U.S. immigration. (Now, they may get it from the airlines).
Even so, as best I can interpret things, you are often required to leave a country using the same document you entered it with, but each time you enter a country is an entirely different "trip."
So, where you might have trouble is at Spain's passport control who might want to know where your stamp is that shows you have a right to be in Spain.