The main thing is not wanted to show potential adversaries the extent of your capabilities. It also allows them to glean information on how to counter the newly disclosed capability as well.
For example: If this was a satellite, the specific one is almost certainly outed. Satellites are tracked constantly and by the angle of the photo and approximate time you should be able to figure out where in the sky it was and what satellites were in orbit. With that you now know to not do anything when those are present.
If Iran isn’t capable of doing that sort of analysis, certainly every other major power in the world is.
Frankly, I’m betting it was the X-37B or a previously unknown spy satellite hiding in plain sight as a commercial satellite.