It's tannins that the wood leaches out. It isn't harmful to the fish and some people actually like the look it gives a tank. It's just a natural occurance and will take time to stop (a long time). It's generally best to soak wood before adding it to the tank but there's really no way to soak it long enough to get all the tannins out.