Taking your points in reverse order:
> I could more see this as being just random action without any real purpose, or aimed at petty revenge on someone, or something.
This was essentially my first point, and I think we are in agreement.
> I dunno. I'm very much not a Trump fan, but I don't see how restricting access to "national information" would help him. And if it would, how does restricting access to one of them help him?
I did not intend to claim that the closure necessarily helps Trump himself. My point was that reducing access to public information (either wholesale, or by placing additional hurdles) hurts democracy and favors autocracy.