Upvote:2
She should show the Spanish passport to the Spanish authorities as the exit passport control desk. If she shows her US passport initially, they will check to see whether she's overstayed, and that will likely cause confusion and delay.
If they ask about the difference in name with the boarding pass, she can also show her US passport. There's no prohibition against dual nationality in either country.