First, shame on the HR rep for not having an introductory script or protocol that checks certain boxes, including a caution about retaliation, refraining from talking to anyone else about the investigation (IF that's appropriate in your case), describing the investigation process for you, etc. At least they were honest and acknowledged not telling you this.
Second, it's important to understand precisely why HR would want employees involved in investigations to avoid discussing the matter with coworkers and others. The purpose is to "seal" an investigation rather than complicate it further by bringing more and more people into it through hearsay, risk witness tampering, destruction and fabrication of evidence, collusion, etc. It's a method of resolving the case most efficiently.
Note, however, that the National Labor Relations Board (NLRB) ruled in 2015 that (nonsupervisory) "employees have a ... right to discuss discipline or ongoing disciplinary investigations involving themselves or co-workers" unless there's a substantial business justification. Thus, I'm not sure whether the issue of confidentiality is appropriate in your case or not. Perhaps some clarifying questions are appropriate, especially since HR forgot to tell you at first. What's their compelling business reason? It cannot be a blanket policy that they require this with all investigations. I hope they have a well thought out rationale specific to your case.
Regarding your question about whether the evidence is still "usable" -- yes. While HR shouldn't punish you for violating confidentiality if they didn't tell you not to talk to coworkers, the workplace is not a courtroom. The warning about confidentiality is not like Miranda rights. There's nothing wrong with the evidence against you unless someone colluded or destroyed evidence. That's a different matter.
Of course, you can always suggest names of coworkers or others as witnesses for an investigation if they have important information to offer. You may also remind the investigator politely that you wouldn't have talked to your coworkers had you known about the requirement for confidentiality.