Just a guess:
"Both" precedes the articles because the articles can be different depending on the situation. Therefore, if "both" is placed before the articles, it applies to both articles.
I bought both a piece of paper and a pencil.
I bought both the shirt and a tie.
I bought both my books and a backpack.
I bought both the books for my class.
A question for other teachers or V:
Is the original sentence supposed to be, "I bought both of the books for my class," since we are only talking about books?
I think it sounds better, but I donīt know if it is correct...