It doesn't because of the problems black will have along the e file (potential pins to the king). Play through some of the lines where it is taken.
It's not bad to take it, it's just the open rather than the closed Ruy, and can lead to the famous Berlin Wall variation.
In this position, the chess.com Game Explorer shows the most common next move for White as 0-0. Why does this not simply lose a pawn? Thanks for your help.