It has to be grounded to the grounding bond IN THE MAIN PANEL. The pipe may or may not be a "usable" ground. If it connects to plastic pipe or has a dialectric union, you have no ground. If this is a gas pipe, this is even worse. Either way, this is NOT legal according to the code. His license should be revoked for violating the code. No other reasons are needed. I am not an electrician, but even "I" know more than the asshole that claims to be your electrician. How do you know he is even a licensed electrician? Did you see his license? If he really has one, it should be revoked.
It's not even legal to run a green wire alongside of a non-grounded romex to the breaker box grounding bond. However, that is at least safe and to be honest, I think it should be legal. But the code is the code and you got an "electrician" who is an idiot. Sounds to me like he's be better working as a garbage man or paperboy.