Wondering...welcome to FlyerTalk and the Travel Safety/Security Forum!
I'm sure you'll get many opinions as to what occurred in BOS. My take is that it was strictly random. The routine gate screenings have gone away for the most part but I still see the occasional "surprise" secondary gate screening at various airports.