Before flash we had Java Applets, or Active X, after that and before HTML 5 there was an attempt to make silverlight useful.
Flash had all the GUI elements we wanted, easy to code, and loaded relatively quickly and used a lot less bandwidth than other methods. Adobe went out of its way to make sure it ran on major OS's and browsers.
Until HTML 5 HTML didn't have too many way to handle Vector graphics, or animations. Not blaming early versions of HTML because with average speed being a 9600bps modem. Its early design were good for document delivery. However by the late 1990's HTML became an Application Interface protocol, you can complain about that, but it happened and it won't go back. Flash was the only decent choice for richer set of data.
Now there were cases where Flash was used where it shouldn't be. A lot of stuff you can do in HTML 4 was done in flash. But that doesn't make flash a bad product it was the best tool for the time.
Today not so much, and it should be time to sunset it. But to say it stunk is giving it a gross disservice.