Simple, because they evolved that way, and their breathing needs to continue as they swallow their prey, the most obvious ones are snakes especially pythons, for it can take a very long time for them to swallow a large animal whole.
Some animals (like an anaconda) have a breathing tube in their lower jaw that leads to their lungs and enables them to still breathe when their throat is blocked while swallowing their food. But most carnivores can tear off a chunk of the prey and swallow it just fine. And if for some reason they cannot handle it, they can regurgitate it.
Even small carnivores like jackals who often steal a lion’s kill when the lions have eaten all they desire, can tear off a piece and drag it away to eat it in safety. NOTHING goes to waste in nature, there is always a “clean-up” crew that feeds on a carcass right down to bugs, beetles, and worms; even an eagle or other bird can eat off of the carcass and even carry away small chunks to feed their young.
Mammalian oral anatomy is unique among vertebrates in that we have a very narrow pharynx (back of the throat). Most vertebrates swallow their food via “pharyngeal emptying” and just basically push a large amount of food down a wide, non-muscularized gullet (neck muscles aid in pushing the food down).
Mammals instead have a muscularized gullet (those neck muscles now form the muscles of facial expression, including the cheeks that help in food processing), and only swallow a discrete small lump of food (a bolus) after it has been thoroughly chewed by the teeth (other vertebrates don’t chew up their food like this).
(That’s why you can keep chewing chewing gum without swallowing it, it never gets small enough to trigger the swallowing reflex.) In summary, many vertebrates can easily swallow their prey whole, but mammals can’t do so.