A large part of imprisonment's punitive nature is losing certain freedoms. It is not undemocratic for one of these lost freedoms to be the right to vote. While serving their sentences, prisoners should lose their freedom to vote in the same way that they lose their freedom to choose their place of residence and move freely in society.
Also, giving people who have displayed no respect for the country's laws a say in choosing them makes no sense. If a person doesn't respect the law enough to obey it, they shouldn't be allowed to participate in dictating it.