If your locale were to escalate to wartime-like measures for some reason (because of real threats, or some crazy/rogue leadership), couldn't recording aircraft movements and transmissions be suspicious, and sharing that data be suspected spying/treason?
Probably but then you'd have more pressing problems than just getting some flight statistics.
Also military planes on active war missions don't broadcast ADS-B for obvious reasons. We do sometimes see them on training missions though. Most platforms block them but ADS-B Exchange doesn't.
If anything, commercial / civilian planes would have ADS-B enabled near warzones so that those with anti-air know to avoid them. Didn't work for MH-17 though.