Alien that resides in a country might not know enough of the country or might not show enough willigness to integrate. Some foreign tend to live in a close communities with little exposure to exteranl society. The right to vote cannot be given to person just arrived in the country
The right to vote is automatically given to all adults nationals, except for very limited exceptions (major criminals) without any check of their kmnowledge of the political environment. So the argument of not being integrated can not stand. Also to mitigate the objection the law might impose limits to foreing people eligiblity to vote: some swiss cantons (like Neuchatel) gives right to vote only to permanent residents: this status can be obtained only after 5 years of residence and with some background checks by Immigration Office.