He'd have to have reasonable suspicion to pull you over, which could amount to just about anything. Then, all he'd have to do to search the car was have probable cause (smelling drugs, for example). I do believe you should've been read your Miranda rights. However, they probably had good reason to get you for paraphernalia. Cops don't sit around all day and just 'mess with people', even though many are probably going to disagree with me. IMHO, if you're going to do it, you should be ready to pay for the consequences.
