"I do not understand it when several students attend classes without textbooks". Here, "it" refers to the condition of non-understanding the writer has when the event of several students attending classes without books occurs.
A case could be made that there is nothing wrong with the sentence. This would indicate that the writer lacks understanding (an inability to learn) when several students do not bring their books to class, though how this could happen is beyond my understanding. The nearest I can get to this concept is, "I do not understand when drinking a bottle of whiskey".