They did this in Venezuela too, and I’m sure they do it in other autocratic countries.
This is kind of paradoxical, but when there’s not a real choice, it’s a bit demoralizing to win. The only way to keep your ego intact (and given that autocrats are usually narcissists, ego is the most important thing) in such a situation is to convince yourself that you would win even if the game was not rigged. And the easy way to achieve that is to get lots of people to vote for you, even though they didn’t have a choice.
If this doesn’t make sense to you, you’re right, but humans in general are not rational beings.