Meh. I don't think it's fair to say he "ruined his career". Cejudo had an unbelievable 2 year run where he won 2 belts, defended them both, and beat the consensus greatest FLW of all-time and consensus two greatest BW's of all-time in the process. That's about as good of a 4-fight run as anyone can possibly have. He accomplished everything.
You can say he retired in his prime, and that's seemingly true... but also he was 33 years old when he beat Cruz, and had a lifetime of high-level athletic competition under his belt. That's the age when most BW's start to decline anyways... so you could make the argument that he walked away at the perfect time. It was a valiant effort coming back at 36 to take another shot at the belt, and he very nearly pulled it off.... but regardless, he had a fantastic career and his name will live on in the history books.