Whether people agree on the semantics of words like thug is really not relevent to the topic. The topic was about whether police have the right to search, correct? Or if they were being corrupt? I checked FindLaw.com and found this: Once police have validly stopped a vehicle, they may also, based on articulable facts warranting a reasonable belief that weapons may be present, conduct a Terry-type protective search of those portions of the passenger compartment in which a weapon could be placed or hidden. 65 And, in the absence of such reasonable suspicion as to weapons, police may seize contraband and suspicious items ''in plain view'' inside the passenger compartment.
Since it specifies reasonable belief, they are basically saying if the officer can convince a judge that they had reason to search, then the searching is allowed. This is because you were stopped for a valid reason (broken light). Had there been no reason to stop you, it would have been illegal to search.
It still doesn't mean it was right of them to search you, all I am stating is it could be legal for them to do so.
Since I do not know the specifics, like who you were with, what the area's like, what the personality of the cop is, or any number of details that would contribute to the event, I can give neither validation nor condemnation for the officer to have done so.