Relationships are imperfect and we all mess up at some point or another.
It usually takes being dumped several dozen times before a guy like your boyfriend starts to do the hard work of unpacking and dismantling his assholery.