It's cute, really. Country A turns a blind eye and even helps country B vacuum all of it's citizen's data. Then country B gifts back to A. And vice versa.
Since country A didn't do the surveillance, it didn't break any laws. Furthermore, it's legal to accept data from third parties.
As to why country A would allow even its senators and congressmen to be spied on by B? That's obvious - country A's intel agencies are most interested in their budget!
But this is a special case. It's Israel.