There can be a few reasons for this. You may have overcooked it, the fish was not fresh and low quality. Always use a kitchen thermometer and check your fish a little earlier than the baking time in the recipe states.