There was a fad for a while in ancient Egypt to keep crocodiles as pets. But it did not last very long. While crocodiles were popular as pets, they were dressed in jewels. They were free to roam around a home or a temple. It was quite dangerous.
Historians believe that probably crocodiles became popular because the beloved Egyptian god Sobek had a crocodile head. Sobek was responsible for controlling water and marshes. He was a very important god.
But there was another ancient Egyptian deity with a crocodile head - the terrifying goddess Ammut. Ammut. Ammut was known as the "Eater of Hearts". The ancient Egyptians believed that Ammut was always on hand in the magical Hall of Ma'at after you died, during the weighing of the heart ceremony. If your heart was heavy, Ammut would gobble you up, and you never reach your afterlife.
As much as the ancient Egyptians wanted to make crocodiles happy, in honor of Ammut or Sobek, they were just too dangerous to keep around.