No, the officer does not need to tell you why he stopped you. You would find out if the case made it's way to court when you look at the arrest report.
Usually police officers do tell a detainee why he or she has detained the individual. In fact - almost always. You can submit a complaint to the police department where the officer is employed if you believe the stop was a mere pretext or ruse for something improper.
Judith M. Fouladi, Esq.
Sorry to hear about the incident. You should file a claim against the officer, if for no other reason than to prevent this from happening to someone else.