In fact, insurance companies do not ALWAYS make money. If there is a legitimate claim which is covered under the policy, the underwriter most likely loses money on that policy. Of course, on the whole the companies do make money or they'd become insolvent.
However, it's not exactly a "gamble" where only one side wins. Consumers buy insurance policies to mitigate what they feel is a sizable risk (in this case, the cost of a vacation). Insurance companies use data to asses their risk and willingness to "gamble" on issuing the policies. Similar to consumer rebates (or casinos), they more-or-less know what percentage of issued policies are going to generate claims. I've had insurance companies decline to offer me property coverage in certain amounts one year, and give me a good rate on the same coverage the next, even though nothing about my side of the situation changed.
Another consideration is the cost of the policy versus the cost of the trip. No matter your financial situation, losing a $10k vacation will hurt a lot more than losing a $2k vacation, so the cost of mitigating the risk of loss may be more justifiable as the cost of the trip increases.
With trip insurance, I'd check credit card perks and associated terms and conditions before I purchased a standalone policy. I have never purchased a standalone policy because I've been comfortable with the coverage provided with the credit cards I've used to purchase the trips.