R.,
I don't know the laws of your state, but think of it this way. If the boy to whom your son was directing those comments complained to someone, and then, that person took the complaint to staff, the school is going to check it out. The principal is doing what he must as an administrator by looking into this and letting you know.
It looks from your post that the recipient of the comments wasn't even the one to say anything. Perhaps one of the other boys who was in the text-group thought things were getting out of hand, and he may have felt the need to get an adult involved. You know how we always tell kids, "If you see something, say something? and to report bullying.
I am NOT saying your child bullied this other boy, BUT apparently someone, somewhere along the line took something your son said as a cause for concern.
If there is even a hint of a possibility that one of their students is being bullied, threatened, or harassed, (even if you son did not intend it to be that), you can bet the school is going to check it out. In the wake of the many school tragedies that have occurred in recent years, school administrations are forced to investigate things more than ever.
Bottom line is, you don't know because you haven't seen the texts. Sometimes, what kids think of as "banter" ends up being more hurtful than they realize.
You should ask to see the texts, just so you have full knowledge of what's going on. Then, you should have on-going conversations with your son, and any other children you have, about NOT putting things that can be misunderstood or misinterpreted in texts, emails, or on social media. You should let him know that once it's out there, even if HE erases it, that the message exists somewhere (on someone else's phone, someone else's page, or a snapshot of his words or photos that someone took with THEIR phone).
As a parent, you should also routinely monitor your child's electronic communications and social media for reasons just such as your example here. We have to be the ones to teach kids what is acceptable and what is not.
To me, it wouldn't matter whether the communications took place outside of school time. The fact that such communications existed at all would disturb me. So the question of whether the school has jurisdiction, to me, is irrelevant from a parenting standpoint.
Hope you can get this straightened out and your son learns a valuable lesson from this.
J. F.