The League average age is 26, Houston's average age is 25 and Enes is 29.
You are right that he has never been a good defender so why would Boston sign him again knowing he isn't. It's not like he just quit playing defense and they were shocked by it.
Houston is a bad team building for the future. A 29-year-old who is at best your third best center makes zero sense to keep.
Celtics needed cheap depth at center. All they had was an injury prone center in Robert Williams, Al Horford who hadn't played in foreer since OKC shut him down early last season, a smaller Grant Williams coming off a disappointing season, and a largely useless Bruno Fernando. With Williams taking a leap and staying healthy, Al Horford still playing well, Grant Williams taking a leap, and being able to get Theis, Kanter was beyond useless in Boston.