In Denmark it was public who voted for what until around 100 years ago. In the first secret election where employers, landlords and other people in power couldn't see who their subordinates voted for the workers party got markedly more votes.
Think about it, it's easy for an employer to say that he will only employ people who voted for X, a landlord that will only take in tenants that voted for the right party, or even family members that will make sure that everyone votes along party lines.
There's a very good reason why voting is secret.