a) the secret ballot was introduced into the US (originally as the "Australian ballot") many years after the ratification of the Constitution
b) no amendment has prescribed it
I find it hard to quarrel with the judge. I do consider the secret ballot an excellent idea, but I don't see it as constitutionally mandated.