Flash didn’t have to be inefficient, but Adobe’s implementation certainly was. I remember the Mac version of Flash pegging the CPUs of PPC G5 and Core 2/Core 2 Duo based machines, turning them into space heaters until the user navigated away from the page containing flash elements. For the vast majority of what Flash got used for, that was in no way justifiable, particularly on devices like laptops and smartphones.
HTML5 by and large didn’t have this problem. Was it possible to write a grossly inefficient HTML5 site? Yes, of course, but it wasn’t the default state, as evidenced by how much happier those same machines mentioned in the last paragraph were when running e.g. the HTML5 YouTube player instead of the flash one.