Better Call Glew: A Case of Improbable Cause
As long as the officer had probable cause to believe you committed a crime, which in your case was a Vehicle Code violation for speeding (however slight), he or she is free to pull you over and investigate any unrelated criminal activity. Whether it was the officer's subjective intent to give you a ticket for speeding or to find any reason to pull you over to investigate you for DUI, as long as there is probable cause to believe a crime has been committed, the officer's subjective intent is irrelevant.
In my experience, it is not at all that uncommon for DUI investigations to stem from the most minor Vehicle Code violations. What is even more unsettling, even if an officer pulls you over for violating the "wrong" statute, the stop does not violate the Fourth Amendment, so long as there is a "right" statute that applies to your conduct. That is to say, if an officer pulls you over for speeding, but it turns out that you were not in fact speeding, the stop is still legal so long as there is another basis for the stop, such as having a broken tail lamp. The lesson to take away from this is that you can be pulled over for the smallest of infractions as a pretext for a collateral criminal investigation and that officers have a great deal of leeway in justifying such stops. You've been warned!