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.
Well, in many other languages it does take a definite article, so I would say it's more a peculiarity of English than a peculiarity of Esperanto.
Perhaps the question should be the other way round: why English doesn't use a definite article for mankind? The answer: English doesn't use a definite article before nouns that represent a whole class. For example «the dogs are ok» means that a specific set of dogs (such as the dogs I might have at home) are ok; on the other hand, «dogs are ok» means something different: dogs in general, as a species, are ok, not just my dogs or your dogs. In languages like Spanish both sentences would be the same, «los perros están bien», and to distinguish between both meanings some extra information must be included («mis perros están bien» vs «los perros, en general, están bien»).
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 :)