To avoid the harm, the scientists, the media, and the public could have worked together to prove Wakefield wrong. However, in cases like this, it is almost impossible to completely avoid harms because there is a group of researchers and lawyers involved, and it is difficult for media and public to determine which party is right and which one is wrong.
It definitely needs time and efforts to prove righteous of one, but as mentioned, media and public could have played an important role to support the scientists.