He doesn't say he always buys a book when he is near the station. He says that when he buys a book, it is always near the station. You will notice that the sentence starts with だから, indicating that this sentence explains /clarifies/amplifies something that came before this sentence (and which you haven't shown us, so we feel like we're walking in on the middle of a conversation).
There is a reason for は being there instead of を. It could be for emphasis or for contrast (he buys his books near the station, but not other things). Hard to say with just this fragment you've given us.
I'm afraid you missed a couple of key subtleties....