There is nothing wrong with using the gift of tongues to thank God. In fact, it is something that Paul commends. The problem arises when this is done in public worship (without interpretation), because then the other person
(the person who cannot understand the tongue) is not built up.
17 Tu rends, il est vrai, d'excellentes actions de grâces, mais l'autre n'est pas édifié.