Once upon a time, voting was not secret and you had to declare openly who you wanted to vote for. This could lead to intimidation, including being sacked from your job if your employer didn't like the way you voted, or being evicted if you rented your home and the landlord didn't like how you voted. YOU might not judge someone, but this kind of thing used to happen. I can think of other things, like families with members who vote differently could have arguments - with a secret ballot, whoever you disagree with doesn't need to know what you did. It's YOUR choice to tell people how you voted. Or not tell them. No problem in my family as we pretty much all agree anyway, but I've heard of that happening.
In the UK, this was changed by the Ballot Act 1872. It had become more of a problem when many more people were allowed to vote in 1867 and the feeling grew that intimidation by the rich who had control over people's lives had to be stopped. The Act lays down detailed rules so that voters no longer had to say who they were voting for so the clerk could write it down, but instead received a ballot paper to mark their vote on and a sealed ballot box was provided for the papers. This makes your vote secret.
So there's a bit of history! All the things we know so well - getting a ballot paper, going into a little booth with a pencil in it so you can mark your vote in secret and fold up the paper, and the box to put it in - all started in 1872.
British elections also could be riotous, There would be arguments and fights between supporters of different parties, so another argument for having the secret ballot was that disorder should reduce. And the first election conducted this way in 1872 proved this was true - it was much more orderly
Voting doesn't have to be secret - it wasn't for centuries and voting at meetings is still usually done by a show of hands. But for national and local elections, where politics are involved, it's a good idea for several reasons.