Is it legal for schools to publish SAT scores to the student body...

Not sure how they would know your SAT scores without consent… If you sent it to the college, then you gave them consent. Schools generally only post average scores of those who accepted the acceptance, so your test score itself wouldn’t be available.

If you’re talking about high school, I have no idea about the standards that way but I haven’t really heard of high schools publishing students’ standardized test scores.