Judaism isn't just a religion; Israel happily accepts non-religious Jews. The goal was to solve a massive refugee problem for a persecuted group with nowhere else to go.
In any case, as a sovereign state, Israel gets to decide on its own immigration policy, regardless of how foreigners feel about it.