We have secret ballot so voters can vote for who ever they choose without fear of retaliation by political bosses, bosses at work, union bosses, the mayor, the sheriff, who ever. Secret ballot has been standard in the US since the revolutionary war. It's an established bulwark of democracy. Countries that lack secret ballot are regarded as banana republics.
Next to voting, contributing money to candidates, parties, and causes is the basis of political liberty. Many, perhaps most, would prefer to donate anonymously to protect themselves from retaliation, harassment, assault, strikes, picketing, and kidnapping by the political opposition.
So why not allow citizens to donate anonymously?
Largely because of a dense web of campaign finance laws passed by "good government" (Goo-goo) groups over the years. I ran for a minor state office up here in NH some years ago. I raised less than $1000, which I spent on yard signs and palm cards. I had to file forms monthly in Concord listing name rank and serial number of each of my contributors. PITA. The "good government" groups feel that campaign contributions are the same as bribes and attempt to outlaw the practice.
The Goo-Goos are mostly democrats. They oppose campaign donations because the Republicans have members who will write checks. Democrats are mostly academics, newsies, union people, students, welfare people, and incumbent pols, none of whom will write a check. Partly 'cause they are cheap, and partly 'cause they don't have any money.
The country would be more democratic if we scrapped all the campaign finance laws and let anyone contribute as much as they please, and keep it secret. The Supreme Court, in the Citizens United case agrees with me.