I think it is to give incentives to people to get them inside the door. While the companies are sure to lose money when giving out anything for free, I think it is a pretty safe assumption to make that once a potential customer is in the door that they will likely buy something else, and offset the loss of the free gift. Even if not all customers who get something for free spend money, they only need to get some to buy things to offset the prices.