Because if black takes the pawn, white will regain the pawn since he was the first to castle and can use his rook while black did not castle and had to waste tempo to capture a pawn.
Mysteries of Chess!?!?

I know that the pawn shouldn't be taken, but the basic principle of castling early is still a puzzle. Is it primarily
1. Activating the Rook
2. Protecting the King
3. Stopping any early kingside attacks
4. Just an in between move
I find that a premature castling lets the opponent build up a severe kingside attack while developing and can give an advantage. I therefore wait for the opponents powers to shift to one side, to castle on the other!

In the Ruy Lopez main line, White castles early in the game because, after the usual continuation 5...Be7 6.Re1, he not only defends his e-pawn but indirectly attacks Black's one, this way preventing the thrust to d5 by Black, that would cost a pawn (after 6...d5 7.exd5 N(Q)xd5 8.Nxe5). Furthermore, he threatens to win a pawn by 7.Bxc6 and 8.Nxe5.
All things considered, I think it's well worth for White castling so early!

This topic of yours is interesting. I found myself delaying my castle sometimes just to see where my oponent is aiming his bishops or pushing his pawns. Early castling has this risk of letting your adversary build up a long term strategy on your king with more accuracy. However it's not a good thing to wait forever or you can find yourself open to attack in the middle.
I guess the ultimate issue about when and why to castle has more to do with the opening principles, like activating rooks, connecting them and allowing the early advance of center pawns (and the f file one too) which is way too risky with your king in the center.
anyway... when you castle early your oponent may build an attack on your position, but you won't be sitting there waiting for him to open up your flank just like that... since the only way for him to get a tempo advantage from your castle is NOT to castle himself and that's risky for him so... it all depends on how you look at it.
I am trying to improve my openings and have looked at other peoples games. I have been confronted by several high level games with this opening. I am interested why higher ranked players castle so early!