How this can be possible and what for?
A miner is under no obligation to include transactions in a block, but there are incentives for them to do so:
- the miner will make more revenue, since they will collect transaction fees
- miners are invested in their operations, and thus want to see bitcoin succeed. If no miners processed transactions, bitcoin would not be functional (and thus miners may lose money on their investment)
There are some times that it makes sense for a miner to make a block with no transactions in it, for example when a miner hears about a new block on the network, they may first validate the header, and then afterwards validate the entire block. The miner wants to begin mining on top of the new block ASAP (mining on an old block would be a waste of money), but they have a small problem in that it takes a tiny bit of time to download and validate the entire block's contents. During this time, the miner will be unsure of which transactions are in the new block, so in order to guarantee they do not accidentally re-use an already-confirmed transaction, they will attempt to mine an empty block while waiting for the validation of the previous block to finish.
Even though this only happens for a very short amount of time, given enough blocks, probability says that eventually, a miner may find a valid, empty block in the seconds following the last block.
Additional question: If this is so easy to generate such blocks, what stops miners to generate these (lightweight) blocks as many as possible to earn new bitcoins?
The number of transactions in block does not affect how easy it is to mine a block. Finding a valid empty block is no easier than finding a valid full block.
Some related questions that may be of interest: