The ethnic cleansing that happened when Israel gained independence was not in just one direction, Israel also did allow plenty of Arab/Palestinians to stay and gave them citizenship where feasible. It's not surprising however that Israel doesn't currently offer citizenship to a population that largely doesn't think Israel should even exist. States don't normally give citizenship to their non-citizen enemies.
> They also allow people to convert to Judiasm and enter, so it actually has nothing to do with their ethnicity and is solely based on religion.
It's not solely based on religion. It's also quite rare for people to convert to Judaism in general so that exception has little practical implications.
This is clearly a racial ideology.
The reasoning behind the 1970 amendment is usually traced to the Nuremberg Laws. Nazi Germany defined a Jew for the purposes of persecution as anyone with a Jewish grandparent. The amendment drew Israel’s circle of protection at the same radius: if having one Jewish grandparent was enough to be persecuted, it should be enough to be given refuge.
From https://masaisrael.org/law-of-return-israel> Converts to Judaism who wish to immigrate to Israel are evaluated on a case-by-case basis by the Israeli Interior Ministry, which determines whether the conversion was sincere in its view