Negative-yielding bonds

Negative yielding bonds are bonds which have a negative interest rate. It means that when a person buys those bonds, instead of generating profit, they lose money. Why would anyone buy such bonds then? Some institutions are forced legally, others are betting and hope to make money.