I feel for you, OP, and am very sorry this happened to you.
Having been banned from a church myself, I know it’s an awful feeling. As has been stated, however, this is the pastor’s privilege. In my case the action was more than just a little extreme—it was objectively unfair. I completely disagreed with him, but I accepted my banning without complaint. A month later, Father went back on his original decision and we have not spoken about it since.
I cannot speculate on why your priest reacted as he did, but as I learned with my own, you can’t control how he behaves. You can only control how you behave. As difficult as it may be, I advise you to apologize to him. The sooner, the better; do wait long enough to cool down, but no longer than that. Based upon what you have said, I believe Father owes you an apology as well but you can’t make him give you one nor should you withhold yours until his own is forthcoming. We can’t be happy if we don’t forgive those who wrong us. Once you’ve said you’re sorry, then see what happens. You might see a change right away, or you may have to wait. In all honesty, you may never see anything improve. But wait and see.
If you remained with him in spiritual direction for two years, you must have seen some value in continuing that relationship and he must have seen some value in guiding you. Please don’t throw it all away due to one moment of conflict. Whatever happens, do pray for him.
God bless!