And, for that matter, why does Jasmine make Steelix do the same thing?
Since your anime questions will almost never get a good logical answer, I'll take the one some random guy said, and paste it here. He explains it the best.
The only real answer here is:
Unlogical logic (also known anime logic)
Its the same reason that electric types are good against ground types, or that ash and co. somehow meet legendary Pokemon at least once a month. It makes for better stories.