Hi. Your ex put himself in this situation... why do you have to get him out of trouble??? Why is it your responsibility??? You and only you is making it your responsibility.
Like Dawn says, you're codependent just like most of us. Now you need to learn how to not be codependent. Read Co-Dependent No More by Melody Beattie and go to Al-Anon. Learn how to be free of other people's problems so you can concentrate on your own life instead of theirs.
Take care and let us know how it goes...