Though the morning was cold, Tom was happy and warm; (23)
Given the first twenty-two lines of the poem, this line has to be ironic, right? How could Tom be "happy and warm" when the life of a chimney sweeper is full of so much suffering? "Warm" rhymes imperfectly with "harm," which tells us that there is something fishy going on here.
So if all do their duty they need not fear harm. (24)
The lines suggest that children should just suffer, if that is their lot, and nothing bad will happen to them. Wait. What? That doesn't sound right. Frankly, it's hard not to read these lines ironically, as if they were a parody of the kinds of advice we usually give children (things like, "stay in school," or "follow the rules").