There are many resources (e.g. this) about ways of creating legally binding terms and conditions for a website. What I don't understand is: why can't a user claim that terms and conditions were not displayed to him or that he was allowed to proceed despite not checking the box or clicking the agreement button (e.g. due to a malfunction of the website)?
The user can always claim that. Whether such a claim will be believed is another matter. A party to a contract with a "wet-ink" signature can claim that it was forged or that the signer was impersonated. But such claims are hard to prove, particularly if they are not true.
The answer to the question in the title is that terms are binding if the user freely agrees to them, and if they meet the conditions for a legally binding agreement in the relevant jurisdiction. The question in the body is more about what evidence will establish this.
Suppose the code behind a web-site is so designed that no user is allowed to proceed without affirmatively accepting the ToS, and the operator can demonstrate this. That will be persuasive evidence that the user did accept the terms. If the site logs the consent in a database along with a timestamp that would be further evidence. A journaling database provides an audit trail of changes, which would be further evidence.
Evidence of other users that the site always worked that way, and of coders that the code had never permitted a user to proceed without accepting the ToS might also help. Backups of the DB stored with a 3rd party including the consent logs would also provide evidence that the timestamps were present and unchanged. A hash of the log can be stored on the blockchain.
The site could also send a "registration accepted" email to the user (if the user has provided an email address) which could include a mention that the user had accepted the ToS. Such an email would be reserved in the logs of the senders and receiver's email providers, and could be retrieved as evidence.
Ultimately it will be a question of what the finder of fact believes, if the matter goes to court. And as user Amon says, the US standard is preponderance of the evidence (that is, the evidence is at least a little bit stronger on one side. This is sometimes loosely expressed as more than 50% or 51% or better proved, but courts do not in fact measure degrees of proof in numbers), not absolute proof.