Sometimes people complain about an earthy, muddy, or dirty flavor in tilapia. This can be caused by algae and bacteria in the water where it was farmed. It can also be caused by the fish meal the tilapia consume.
The best way to avoid this earthy behavior is to buy fish farmed in the United States, Ecuador, or Peru where there are strict requirements for farming practices that ensure the fish isn’t overcrowded or fed improperly, which can cause those muddy flavors.
If you find yourself with fish that tastes muddy or fishy, soaking it in buttermilk for 30-60 minutes before cooking can reduce that flavor. Marinating the tilapia in acid like lemon, lime, or vinegar also helps.