Can't answer for the reasoning behind this trope.
But it seems pretty frequent, so much that BlogSuki's Jason calls it the First Modern Law of Anime:
“All major characters will have their desk window side towards the back. Sub Law: If a romantic interest occupy the same classroom, that character would be within one desk of this desk.”
(the sub law seems to work with rivals too)