Really, really unfortunate--but I hate to say, really stupid thing for your friend to do at this time.  Terrorism and school threats are at such of a height of enforcement attention, that there is a no tolerance for even joking.  He needs a good lawyer--because there are first amendment issues here and obviously bail issues.