Did the Israeli forces intentionally depopulate Arabs villages towns and cities in Israel in the 1948 war If yes then why did some Arabs remain in Israel ?

Yes, the ethnic cleansing was preplanned and it wasn’t an accident of war.
For various reasons, such as a commander’s decision during war, or the location of a village, or just by pure chance, some Palestinians were not ethnically cleansed during and after the establishment of Israel. It is estimated that around 20% of the original Palestinian population remained while the rest were forcefully expelled through various means.
This does not mean that the spared population had sided with the Zionist forces. For example, the city of Nazareth was spared because the Zionist commander thought that ethnically cleansing such a large amount of Palestinian Christians at the same time would look bad for Israel. However, ethnically cleansing smaller Christian and mixed villages around Nazareth and elsewhere was fine.
It should be noted that the destruction of Palestinian villages had nothing to do with whether they participated in the war of 1948 or not. Neutral villages with non-aggression pacts with the Yishuv were also ethnically cleansed.
The small minority of Palestinians, about 160,000, (back then) who had managed to avoid expulsion and remained in the part of Palestine that had become Israel were now citizens of that state. Israel’s government, dedicated above all to serving the country’s new Jewish majority, viewed this remaining population with deep suspicion as a potential fifth column. Until 1966, most Palestinians lived under strict martial law and much of their land was seized (along with that of those who had been forced from the country and were now refugees). This stolen land, an expropriation deemed legal by the Israeli state, including the bulk of the country’s arable areas, was given to Jewish settlements or the Israel Lands Authority, or placed under the control of the JNF, whose discriminatory charter prescribed that such property could only be used for the benefit of the Jewish people.