Setting aside the categories of art and literature, training LLMs on FOSS software seems aligned with the spirit, if not the letter, of the licenses.
It does nothing to fix the issues of unpaid FOSS labor, though, but that was a problem well before the recent rise of LLMs.