You did the right thing.
It's ok to insist on basic decent language and behavior, even if they think you're a square and uptight.
That's them pushing the boundries to see where they are.
Your son will respect you for your standards a little further down the track.