Cotto, 37, had announced before the defence of his WBO light-middleweight title that the fight would be his last.
But the Puerto Rican, who won world titles in four weight categories, could not handle the quickness of 29-year-old Ali.
“I am good, and I want to be happy in my home with my family,” Cotto said.
Billy Joe Saunders praises retiring WBO champion.
Reflections on Cotto on the BBC Radio 5 live boxing podcast.
Cotto’s career ends with 41 wins and six defeats. He suffered an injury to his left biceps in the seventh round at Madison Square Garden (MSG) and struggled to make an impact in the fight.
After 12 rounds the judges scored the fight 115-113, 115-113, and 116-112 to Ali.
“I’m feeling good with the performance,” Cotto said. “Something happened to my left biceps but I don’t want to make excuses, Sadam won the fight.
“I am proud to call MSG my second home. I had the opportunity to provide the best for my family because of the sport.”
Ali added: “I want to thank team Cotto. They could have taken an easier fight if they wanted too. I had him hurt here or there in the first couple of rounds. I knew I had to do something, or he would have dug in”.