The environment of the tank is different from the water it would be released in. The fish has adapted to that new environment, even if it did come from the wild. Their is a risk of the fish taking something (bacteria/virus/etc.) from the tank and releasing it into the wild with it. The wild fish will not have adapted to it. While the risk is small, it is still there.
It could also be illegal.
It could also be illegal.