The Sherman became a tank on par with the Panzer IV once the 76mm/17lber gun was mounted, and wet ammo storage was included.
It is true that the early Shermans had two fatal flaws in Europe. An obsolete cannon (75mm cannon was based on a World War 1 French field gun), and ammo storage prone to catastrophic explosion.
However, the reality of tank combat in Western Europe is a much different picture than the statistics would lead on. The average distance of tank to tank combat was a mere 400 yards. During the Battle of the Bulge, during many fights in towns and villages, the fighting took place at less than 50 yards. At these ranges, the first tank to get off a shot is the one that survives.
Secondly, Shermans did not regularly blow up when hit. Usually a round would penetrate the armor, kill a crewman or two, and the surviving crew would abandon the tank. Recovery teams would come in after the battle, patch the hole, scrape out the flesh of the deceased, and the tank could be reused.
Thirdly, Sherman tank losses in some cases had nothing to do with the tank itself. Due to a shortage of tank crewmen, some infantry were given a crash course in operating the M4. Tanking is like flying, its the crew that makes the big difference. These tanks operated by infantrymen were quickly lost.
So after the initial fatal flaws were fixed in the Sherman, it became a capable tank. The U.S. decimated North Korean T-34s with it in the Korean War. The Israelis also had a very high kill ratio with the Sherman in their subsequent wars.