The reason why cats crawl onto the bed to poop may be because they want to relieve themselves in a comfortable environment. The bed is a soft, warm place, so they may prefer to relieve themselves there. Additionally, cats may crawl onto the bed to poop because they want to express their displeasure to their owners. If your cat's litter box isn't clean or fresh enough, they may try to eliminate elsewhere to show their owners that they need more attention.
If your cat frequently crawls into the bed to poop, it's best to contact your veterinarian to make sure they don't have any medical issues. At the same time, you should also ensure that the litter box is kept clean and fresh, and provide adequate cleaning conditions for cats to encourage them to eliminate in a suitable place.