Finland "warned that the proposal could conflict with the Finnish constitution" and Germany "has staunchly opposed the proposal", so I don't think there's going to be an EU law banning end-to-end encryption. So if Spain were to act alone, I can't imagine banning WhatsApp (which uses end-to-end encryption) would go over well with their constituents. It's on 98% of their smartphones and (at least in 2015) they used it more than any other EU country [1]. WhatsApp (like Signal) said it would leave the UK rather than weaken encryption if end-to-end encryption was banned there. [2] I'm sure the same would be true for Spain.
Maybe WhatsApp is lying, but it would put them in a predicament for the following situation: a user from outside of Spain chatting with someone inside of Spain. Assuming they comply with Spanish law, they could,
1. Say nothing and show no warning message. Would generate negative press and distrust in the platform.
2. Show a warning message when a user tries to message someone in Spain. Some would commend the transparency, but the press and public may still be upset that they acquiesced to the Spanish governments' demands.
3. Create an entirely different version of the app for Spanish users. This wouldn't generate much negative press outside of Spain, but Spanish users absolutely would be upset that they can't contact people outside Spain with the app.
This is not an edge case scenario: 15% of people in Spain are foreign-born (likely contacting family and friends from their home country) and 2.7 million Spaniards live abroad (likely contacting family and friends inside of Spain.)
Option 3 is likely out of the picture, but of options 1 and 2, while neither would result in the death of WhatsApp, some users may indeed leave the platform due to it. In order to be worse than losing the entire country of Spain, 2.35% of WhatsApp users would have to leave the app. That seems unlikely, but even still WhatsApp might not feel it's worth the risk, and in any case they'd probably prefer to not have to spend development hours building systems to comply with the law. Easier to just cut them off.
You sue and jail any website operator offering access to encrypted peer-to-peer chats.