If I recall correctly, it goes back to the Pentagon Papers
https://en.wikipedia.org/wiki/New_York_Times_Co._v._United_States
The ruling made it possible for The New York Times and The Washington Post newspapers to publish the then-classified Pentagon Papers without risk of government censorship or punishment
see also
http://www.tuccille.com/blog/2009/05/photography-in-courthouse-may-not-be.html
If I recall correctly, it goes back to the Pentagon Papers
https://en.wikipedia.org/wiki/New_York_Times_Co._v._United_States
> The ruling made it possible for The New York Times and The Washington Post newspapers to publish the then-classified Pentagon Papers without risk of government censorship or punishment
see also
http://www.tuccille.com/blog/2009/05/photography-in-courthouse-may-not-be.html
They are lucky to have any trial at all.
If photography in a federal court is illegal, then why isn't publishing those photos?