It is hard to say exactly why she would guard her secret at such detriment to herself; there is probably a long history of shame, ridicule, and experiences that has made her illiteracy such a horrible thing to her. Under it all though, Hannah is a very proud woman. To admit her illiteracy was to admit that she was stupid and uneducated. It is really an interesting thing--you would think that she would be willing to appear illiterate in order to save her life and redeem her reputation, but she won't even do that. Guarding the "shameful" fact that she can't read is more important to her. Being literate was very important to many in the German culture, and she probably had many experiences in her lifetime that emphasized the fact that to not be able to read is one of the most shameful traits one could have. If you can imagine not being able to read in our society--that would be incredibly limiting, and people would be incredulous and disbelieving if they found out.
If she went to school at all, she probably hid it in order to not be mocked or ostracized by schoolmates and teachers. If she came from a poor rural family that didn't go to school, she probably wanted to hide that in order to succeed in the world and leave her past behind. But in my viewpoint, hiding her illiteracy was foolish; her pride cost her her freedom. Few people would have thought much of it if she had admitted it, and she would have been able to move away and move on with her life, not in prison, hopefully. But, she guarded that secret with her life, literally, and even kept it from her closest companion for a long time, Michael. She didn't even tell him, and that shows how untrusting and defensive she was about it.
I hope that those thoughts help; the book doesn't delve into her viewpoint, so we are left to infer the best that we can as to her motivations. Good luck!