They were brought in as guest workers. French governments tried to restrict or revert immigration a few times (in the seventies I think) but it did not work.
And now, in Brest, deep down (or west) into Breton (Celt) territory, we have a radical Sunni mosque. And woke Americans lecturing me about it's supposedly a great thing.
But if French governments wanted to limit migration from Algeria or elsewhere, they could have done so. It was certainly not an inevitable consequence of colonialism.