Because he was plenty years both Keeper of the Code and Pirate Lord of Madagascar and he took the responsibility with pride –without facing too much stress or trouble–, and it was clear that he didn't want to step down until he died (retiring didn't exist at 18th century either and i guess any form of retiring would look like a weakness) I thought that something made him feel that he was not "man enough" to be a Pirate Lord any more.
According to the books and potc wiki the Keeper of the Code is an extremely important member for the pirate's "community" but he is not exactly member of the Brethren Court. A Keeper has no voice and no role in the meetings exept when the Code is broken or the subject of the meeting is related to the Code (ex: At World's End Court meeting). When Teague was Pirate Lord and Keeper of the Code he could vote but in AWE he just watches the election of the Pirate King. But he could still punish rogues and do trials. So by making himself only a Keeper of the Code, Teague loses his "voice" and he remains in the shadows.
This is a big contradiction with the Teague we see in the books who wants fame and recognition. That's why I believe that something (or someone) made him feel that he was not good enough for being both Pirate Lord and Keeper of the Code at the same time. I have a specific incident in mind but the explanation would be waaay too big and it's extremly dark... I am kind of ashamed to share it even if i remain anonymous...
I am intrigued as to what you think happened, and but I won't force you to share if you don't want to. I will say to anyone who wants to share dark headcanons, feel free. I can easily tag whatever I need to.
I always thought it was only for a few years, and then he realized how hard it is to be a parent, pirate lord, and Keeper of the Code.
But with this information, I am inclined to share your headcanon about it being a specific incident, rather than just a "Holy fuck this is stressful and I cannot handle it" type thing.
Whatever happened had to have been pretty dark and very personal, as Teague probably would constantly fight against that type of thought, as like you said, he wants recognition(I think that has to do with Grandmama and Bartholomew) and would not give that up easily.