Using "that" in place of "it" as an object is not always correct. How can I explain why?

Neither that nor it is grammatical in that position. In fact, what is grammatical is no word at all:

I'm sorry I was absent for class on Monday. What is the homework I want to do before the next class?

Unless of course you meant this, in which case you do need it:

I'm sorry I was absent for class on Monday. What is the homework? I want to do it before the next class.


Assuming it should read

I'm sorry I was absent for class on Monday. What is the homework? I want to do it before the next class.

as @nohat suggested, I think the reason I'd prefer "it" is, "that" is a demonstrative pronoun, and the antecedent (the homework) is very clear from the previous statement. There is no need to use "that" to emphasize what it is the speaker wants to do.