You are already doing the right thing.
Don't let him live with you & your daughter, do not tolerate his drug use.
Good work with getting the courts involved - this may be the process he needs to realize a few things.
Whatever you do, don't start believing his ********. Make him prove through his actions that he is willing to make a change.