It's a fishing exercise (not to be confused with phishing). Basically they're throwing a line out with a free meal, and hoping that something bites. Once they have you on the line, they switch up to a bigger hook and use you as bait to land the bigger fish.
If they can get you in the door with a free domain, and that was what it took to push you over to buying their services, then they just upsell on other items.
Hosts are famous for offering a free domain, free SSL Certificate, free shopping cart, free transfer and any number of other combinations.
There's ZERO money to be made on selling domains these days, but lets take the $3.00/month package for instance. It will cost you about $8.00 for the domain name to give away for free. So if the customer stays with you for 3 months, then you have recouped the initial cost of advertising.
So the cost of the domain is written off as advertising.
Granted, MANY small hosts kick the bucket within a few months of operation, especially if they build up a client base quickly with free offers and demanding clients!