from the attached guidelines...re: Prohibited Conduct...
---------------------
While on Smithsonian premises NO VISITOR SHALL:
-------------------------
>Display or carry placards, signs, or banners
-------------------------
While the Pro-Life hats are not actually placards or banners, they could be considered "Signs" given the writing on them. Also, it doesn't take much analysis to realize that the group was making a political statement that is definitely NOT SHARED by all Americans...ergo, the request for them to remove their hats...btw, I expect the same action would be taken if a group wearing "Pro-Choice" hats refused to remove them.
The fault lies with the kids teachers/chaperones for not being prepared and thoughtful enough to avoid this embarrassing outcome.
Link: https://www.si.edu/visit/tips