The less likely reason: They want you to be near enough to come to the office if there is an emergency. It would take me 2 1/2 hours each way to go to the office, which would be a pain but doable.
The more likely reason: Law compliance. That company in X always had employees living in X. They know the laws, regulations, tax regulations etc. in X. They don't know these things in Y. If they hire someone from Y, there's a big risk that the company would unknowingly do things that are illegal in X or Y. Too much of a risk.
Unlikely reason: The company may have received money from state X to create jobs in X (or even from a town) and hiring in Y would be against that deal.
BTW. Companies close to a state border might have always had plenty of employees from a neighbouring state. In that case they might hire remote workers in these two states, because they know the laws in both states.