I mean if a tax is money meant to go back to the community, that's the same idea...profits are returned to the members.
You are totally missing the point. How the money is used is irrelevant.
Credit Unions are subsidized by taxpayers giving them a competitive advantage over stockholder owned banks. That's why credit unions can pay higher interest on deposits and charge lower interest on loans.
It used to be that credit unions needed a "common bond" such as all the members had to work for the same employer. As such, they were considered a cooperative and therefore their profits were not taxed. They also were only allowed to make consumer loans...autos, home improvement, vacation loans..that sort of thing.
Then laws changed which allow credit unions to make commercial loans just like banks. Also the "common bond" requirement disappeared. Now a common bond might be the customers must live in within the state, or speak English, or must have two eyes.
Those credit unions are no longer cooperatives. They are commercial banks but don't have to pay corporate income taxes, which isn't equitable.