For many decades I have remembered reading a science fiction story that I had thought was A Canticle for Leibowitz. Having just watched an Extra Credits video about that novel, I realized I have been incorrect, and I'll need to read it. In the first place, the story is barely like I remembered, and in the second, I think the story I remember is by Robert Heinlein. It turns out Canticle was by Walter M. Miller.
My memory of the story is vague. What I think I remember involves monks in a dystopian future. I'm pretty sure that the protagonist, a monk, at one point plants evidence about himself that he gambled or some such violation. He may have been guided by a mentor to do so. It would not be good for the corrupt leadership to think of you as a totally pure man. Having a known weakness would actually avoid undesired focus on you.
I skimmed through a list of Heinlein Story names, but nothing rung a bell. Does anyone know the story I am partially remembering?