In short, we're having a plural form here, and »den« is the dative article in plural.
So be aware of singular vs plural articles, and also note that the article »die« has multiple functions, among them nom. (and acc.) fem. sg. article, but also nom. pl. article in any gender. Thus:
- »die Schülerin» (»the female student«, fem. sg.) becomes »der Schülerin« in dative. So »They're giving homework to the female student« is translated »Sie geben der Schülerin Hausaufgaben.«
- By contrast, »die Schüler« (note the missing »in«) is the plural of »der Schüler« and becomes »den Schülern« in dative. So even though the nominative article again is »die«, this time it's masc. pl., and so the dative is »den«. That's why »Sie geben den Schülern Hausaufgaben« is indeed correct.