Because company stores did not sell goods to workers who were in a union.
Explanation:
Company towns were those in which all shops and houses belonged to one organization that was also the largest employee in the area. Labor unions allowed individuals to unite and enhance their working conditions through collective bargaining. You can find more about how such unions worked here.
Union workers could not buy goods because companies did not benefit from selling them to individuals from a union. Working sites were usually located in the remote areas far from other towns, for example, in the desert or other locations with no representation of other companies. Because of this problem, workers had to leave the labor union to live in company towns.