Black holes are often studied (and discovered!) by observing their effects on objects around them. Stellar-mass black holes, for example, can be found by determining the orbit of any luminous companion. Supermassive black holes, by comparison, affect the motion of numerous stars and clouds of gas in their immediate vicinity. By fitting the motions of those stars, astronomers can determine that there must be an extremely massive object in that location, and typically a supermassive black hole is the only possibility.
In the case of M87, these measurements were first conducted in the late 1970s (Sargent et al., Young et al.). Both groups noted that the velocity dispersions near the nucleus required a central mass on the order of $\sim5\times10^9M_{\odot}$. Mass/luminosity ratio profiles were also calculated based on photometry, and both sets of observations noted a steep rise in $M/L$ near the center. Neither group was able to rule out other possible explanations, like a compact star cluster, but a supermassive black hole was - to quote Young et al. - "the most attractive of the models considered". Further observations over the last four decades have ruled out those other options.
The image produced by the Event Horizon Telescope is consistent with a supermassive black hole, as the EHT Collaboration wrote in the first of their papers on the observations:
It is also straightforward to reject some alternative astrophysical interpretations. For instance, the image is unlikely to be produced by a jet-feature as multi-epoch VLBI observations of the plasma jet in M87 (Walker et al. 2018) on scales outside the horizon do not show circular rings. The same is typically true for AGN jets in large VLBI surveys (Lister et al. 2018). Similarly, were the apparent ring a random alignment of emission blobs, they should also have moved away at relativistic speeds, i.e., at ~5 μas day−1 (Kim et al. 2018b), leading to measurable structural changes and sizes. GRMHD models of hollow jet cones could show under extreme conditions stable ring features (Pu et al. 2017), but this effect is included to a certain extent in our Simulation Library for models with Rhigh > 10. Finally, an Einstein ring formed by gravitational lensing of a bright region in the counter-jet would require a fine-tuned alignment and a size larger than that measured in 2012 and 2009.
There are other arguments you can test yourself. For example, the photon ring matches calculations from general relativity, assuming the now-accepted mass of the black hole.
In short: Stellar and gas dynamics require the presence of a large mass in the center of M87, and the image rules out many non-compact objects.