What a disappointment your partner must be to you at this point. You’re right that the problem is not with the moocher who is living off you. Your problem is in your relationship. The fact that you are worried that if you leave, your boyfriend won’t work to get you back is a huge red flag. Your instincts are that he cares more about the relationship with his friend than he does about your feelings. Either that, or he is so afraid of conflict with anyone except you that he can’t bring himself to deal with the so-called friend who is using you both.
From what you’ve said, you’ve been more than generous in your efforts to help a friend. After over a year of tolerating his behavior, it’s way past time for him to move on – either to be on his own or to go to his family or another friend. You’ve done more than enough. Chances are you will never see what he owes you. It is one of those hard lessons about why boundaries and written contracts are important when loaning other people money.
I suggest you sit your spouse down and tell him clearly that you’re done. If he won’t hear you, there is one other option besides immediately moving out. You can tell him that if he won’t go to a couples counselor to sort things out, you will see a lawyer about how to separate amicably. A couples counselor may be able to help you two figure out what went so wrong and how to reclaim your relationship. If you still love him, it’s at least worth a try.
I wish you well.