I'm going to try not to read between the lines and simply respond to what has been presented. Of course we both know that there is more to a statement than the actual words spoken or written.
If I have read you right, you and your friend began to share an apartment while you were both experiencing relationship difficulties. As a result you were partners in commiseration. With the renewal of his relationship with his girlfriend the dynamics of your relationship with your friend changed as he no longer literally suffered along with you. That factor may be at the root of your difficulty regardless how much you may like his girlfriend. At least to some degree.
If the arrangement is at least partially a matter of financial convenience for all parties it may well be worth making the effort to overcome the discomfort you may feel, especially given the alternative. I can certainly identify with the desire not to return home having not achieved any of my goals yet. In time you will and taking advantage of the situation as it has been presented will at least give you that time.
While I have never lived in a situation quite like yours, I can identify with the third wheel dynamic there as I was often asked along on my friends' dates when I had nothing going in that department for myself. I would often go along for something to do, but as the evening began to move toward romance for them I felt quite out of place. I think that is the main reason that when a person marries their single friends slowly drift away.
Whatever you choose, understand that your decision can be as temporary as it needs to be. There is no real shame in going back home empty handed, it is just a hard thing to do. Try not to overthink this one, ok? Take the choice that best fits your needs and go with it.
soaring