State laws differ; some states require the vehicle to be insured while others want every driver to be insured specifically. As long as the car that your friend was driving had insurance on it by the girlfriend (thus he was not operating an uninsured vehicle) it likely will not matter that your friend showed his own insurance card instead of the insurance card for the car.
If your friend received only a speeding ticket then he should be able to pay the fine or take care of it in court. Being in a borrowed car from a friend, with their permission, at the time of the offense normally would not matter to the court. The ticket would usually only affect his driving record and his insurance rates if the citation was written in his name and not against the car.