You did indeed give them the "probable cause" they were lacking. You had ZERO obligation to answer that question and I would hope in the future if this were to ever happen to you again you would man up and exercise your rights.
I hate to tell you this, and yes I hope like hell it bothers you, but you most likely did indeed put this girl firmly in the crosshairs of LE by confirming what they had only suspected before you unwittingly ratted her out.
What they "got from you" was a witness confirming a known prostitute was operating out of that location, which undoubtedly was what they needed in order to get a warrant which is why they accosted you in the first place.
My advice stands, when questioned by LE, "politely" refuse to cooperate, but under no circumstances should you lie to LE. It's a very simple matter to say "Do you suspect me of unlawful activity?" If yes, then you exercise your fifth amendment rights to STFU and if no, you simply ask them if you are free to leave. My legitimate advice is, if you had done as I have suggested, you would have zero worries about LE coming around knocking at your door someday in the future and that poor girl would have been home sleeping in her own bed instead of the jail cell you helped to put her in.
My further advice would be if this were indeed an agency, that after NOT cooperating with LE that you call the agency to give them a heads up. The problem you create by talking to LE, is that if you then call in a warning to the agency after LE has told you what they were looking for, and LE were to find out then you would most definitely have opened yourself up to an obstruction charge.
I am not trying to "pick on you". You asked for advice and I am telling you what you did wrong, the consequences of what you did and what to do in the future if this ever happens to you again