that rule is for CONVERSING , while driving , while having the phone on your ear , you can still converse if you use a handsfree or bluetooth device.
if the OP was taking pictures while the car was in the moving state , then it is wrong. ( although doesn't seems that way).
but if he was taking the pictures , when the car was not moving , i.e at signals , then it is morally/ legally permissible.
back to the topic ,
the main reason for this is the rebellious nature that exists within our minds , when we notice our LAW ENFORCERS , breaking laws , naturally , who would want to follow the rules ,
the public over here always bends the rules against the BIASED , unjust suppression they face from law enforcers.