If you were actively looking for a particular job in your field and around your city and you didn't realize there was an opening that perfectly fit your expectations, then you aren't looking the correct way at all. If I had a friend who had become a colleague, as we studied the same and we dedicate our lives to the same thing, and they got a job that is close to where I live, so now they would move closer, I would be thrilled. Your friend and colleague, whom you like (that's why he is your friend), is moving closer to you and got the job he wanted. If you aren't happy for him, then you seem more like a hater than an actual friend.
Friends get happy for their friends' achievements. But not u/Throwaway130491. He got jealous over her friend getting a great job. And what makes everything worse is that he started to blame other things, not to admit that the problem he has with his friend staying at his place is actually the fact that he is jealous that he got a job he thinks he deserves just because he needs it. Being out of a job is hard, and you can be having a particularly hard time with it. But that doesn't mean that you can be out of your mind. A job is a job. A friendship is more than that. There will be other openings.
What gets me the most about this situation is the fact that this person is sure that if his friend had told him about the job, then he would have gotten it. That is an assumption, not a fact. When you are looking for a job, you are the one in charge of getting the interviews, not your friends. Especially when they are also looking for opportunities. So take the L and move on. The friend is going to live closer, and this person is only thinking of what would have been but never will be.