To add onto other answers, especially @Buffy, I will share my recent experience as a graduate student in a similar situation. I will highlight where the conflict arose, and how you might proceed.
It was about February when I started preparing an application for a well-known, although by no means 'prestigious' summer research internship/opportunity. The opportunity was directly relevant to my research area, and would undoubtedly help develop my applied scientific skills. I reached out to mentors in the opportunity, gained their support of my application, and submitted my application. Crucially, I informed my PhD supervisor too late (I had already submitted the application).
Supervisor's reaction and reasoning
The supervisor was initially very confused - why would I be seeking opportunities elsewhere when I am already in a PhD program? I believe this is a relatively common reaction among professors and supervisors - there is some expectation that the current employment is 'enough', and in many situations, it is! However, there are numerous reasons as to why a student might seek additional opportunities, such as expanding one's skillset, securing additional money for personal financial security, or not having departmental funding in the summer.
Actions I took
Gauging that my supervisor was displeased, I immediately scheduled a meeting with them to explain my actions and, holding my ground, why the internship would ultimately improve my research in the long-run. I explained that this internship is temporary and would ultimately increase my success at my PhD institution. I was very direct and honest - I let the professor know how I felt about the situation, using phrases like, 'When you say X this way it makes me feel Y', such as, 'When you say, 'Why would you be seeking external opportunities, usually that is the role of the supervisor?' this way it makes me feel like I did something wrong by securing a well-known internship that would advance my career and success in the PhD program'.
Once I secured the internship, I kept my supervisor in the loop of my progress, explained what I was doing, and ultimately they felt that they were semi-participating. I also was honest and kept my word - I did not abandon the PhD program and it legitimately helped my success in my PhD research.
Your situation (as it is a bit different)
I would recommend you try the following things:
Before proceeding, ask yourself a few questions. What is your goal moving forward - to move on from this event as quickly as possible? Confront your supervisor? Secure the internship? Understanding this will help guide your actions, emotions, and self-presentation.
Immediately schedule a virtual meeting for as soon as possible with your supervisor. Make the intention of the meeting explicit over email, such as 'Request for meeting to discuss internship X'.
Before the meeting, read the many answers to SE question carefully. Many people have provided excellent insight. First and foremost, your professor has crossed a definite line by effectively publicly shaming you, and, as an adult, you should communicate how this made you feel or how it was perceived among lab mates. For example, 'When you sent an email saying X to the lab, it made me feel as though I was being publicly shamed.'
If your professor is unwilling to apologize/doubles down in the meeting, you may want to do some personal calculus about the situation. If you'd like to keep your supervisor, I would drop the issue. If you'd like to do the internship, explicitly ask your supervisor, "I am intent on doing the internship but I realize that this is causing some conflict. What is the best way we can both move forward from this situation?" Make them engage in the process. Engage them in the process.
Hope that helps, happy to expand any of my points if unclear.