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.