Why is there a dispute over control of Western Sahara?

Becasue France once held Algeria as a colony

France never held Algeria as a colony. Spain did.
The main reason of the dispute was territory, but the Western Sahara is also rich in phosphate.
Actually, France DID hold Algeria as a colony from 1830 until the end of the long and bloody war of independence (1954-1962) when de Gaulle , realising the days of colonialism were ending, allowed the populace to vote for independence- which they did, overwhelmingly, causing the estimated one million french settlers to flee from the country.

The Spanish only held various small enclaves (e.g. Algiers) prior to the French invasion.

The Sahara area was split between Spain and France- whence the Nationalist forces under Franco launched the Spanish civil war.