Allies spy on each other all the time and when caught usually get a slap on the wrist. Pollard's extremely disproportionate sentence is for no other reason than to make him an example for all Jews and their dreaded "dual loyalty."
First of all, Israel is not a US "ally," we do not have any mutual defense agreements with Israel of the sort that we have with NATO nations or with Pacific Rim nations. If they are attacked, we are under no obligation to come to their defense, or vice-versa. So calling them "allies" is disingenuous. Sometimes US and Israeli interests are in alignment, on other times they are not. Foreign policy realists under the Reagan administration (Weinberger, Eagleburger) recognized this.
Secondly, Reagan's defense department made a strong case that Israel was trading US security information to the Soviets in exchange for Jewish immigrants. Pollard was probably well aware of this, so his espionage may as well have been for the Soviets.