Anyone who has watched a police crime drama on TV knows that you are given your Miranda rights before questioning. Two key things your Miranda warnings tell you are that you have the right to have an attorney and the right to remain silent.
You thought it wouldn't hurt to tell the cop your side of the story--after all, you have nothing to hide. Being at a party where someone was assaulted doesn't make you a criminal. And anyway, what were you supposed to do--step in and help? So the cops found heroin there, too. You didn't have any on you. And you got out of there before they could ask any questions.