The -u ending of a verb means something like "the state to which the subject should end up." So "Humanity ought to learn Esperanto" would be:
La homaro lernu Esperanton.
Which by the Duolingo lessons can also more familiarly be translated as "Let humanity learn Esperanto!" in English, which, if you think about it, really means the same thing.
I find it helpful to remember that HOMARO on its own could be translated "a group of humans". So, "THE group of humans", while not necessarily meaning "humanity", certainly is clearer than HOMARO.
However, if the author really wanted to stress that the whole human race should learn it, maybe a different construction like TUTHOMARO could've been used [?]
In Russian and Latin, which do not use the definite article, definiteness is indicated in part by changing the word order, moving the definite object to the beginning of the sentence for example.
Making it a specific word in Esperanto is probably not a bad thing, just like using ĉu to indicate a question rather than changing the word order like in English.
I know, I know.. for all these years here I was the one (well, one of those =) telling the same thing to others - it's only a language course. So, please, don't be surprised if my bear eats your sandwich ;) or whatever else may be happening in these sentences here :)