Casinos don’t make money from no deposit bonuses as there’s no money staked by the player. The reason that they offer free money and aren’t worried about making money on it is that it encourages new players to join their site.
The aim of a welcome bonus is to win new customers over their rivals, although this puts casinos at a loss, they believe it’s worth it because of the number of new players they could attract.