Besides being great companions, cats may have actually saved civilization from starvation and disease.
Imagine living in a time and place where every home was teeming with tiny, dangerous beasts. Some new threat lurked at every corner: asps hiding in clay jars, rats spoiling massive amounts of stored grain, venomous scorpions creeping under cradles. In this time and place-- Ancient Egypt-- one creature existed that could make the world safe from these little monsters: the cat.
The same graceful creatures that now sleep on our pillows were life-saving companions to the people of ancient Egypt. It's no wonder that generations of Egyptians were drawn to worship them.
One of the earliest deities of ancient Egypt was the goddess Mafdet, who was highly revered by people seeking protection against venomous animals like snakes and scorpions. She was shown with a variety of fierce, feline forms, most often as a woman with the head of a lion, cheetah, or house-cat (though sometimes she was shown as a cat with a woman's head). Because cats could protect against the tiny monsters that made Egyptian homes unsafe, Mafdet was regarded as the protector of the home-- and of the kingdom itself!
Later in Egyptian history, the goddess Bastet (sometimes just "Bast") replaced Mafdet as the feline goddess of choice. Like Mafdet, she was regarded as a fierce protector of the home (and especially of children and royalty), largely because of cats' renowned ability to kill snakes, scorpions, and other vermin. Her followers called her the "Eye of Ra," the sun god, and believed that she fiercely watched the world and guarded Egypt against invasion.
As Egyptians truly domesticated their cats, making them valued family members rather than just semi-feral animals that stalked and protected their owner's homes, Bastet's image became a lot softer-- she became a goddess of family, fertility, and love. Egyptians began regarding their cats as loving, important members of their families, and treated them with as much respect and dignity as their own children. Followers of the cult of Bastet would mummify their cats and mourn them in the same way they mourned human family members-- and in much the same way we cat-lovers mourn our own furry family members today.
We tend to joke about how cats feel entitled to worship. Anyone who's ever known a spoiled tomcat knows that cats have never forgotten the days when they were worshiped. The worship of cats in ancient Egypt was well-founded. Cats once saved lives by defending families from vermin. Without them, civilization as we know it might have never survived!