It hasn't always been that way, LBJ got laws passed to limit pastors ability to advocate for candidates, in the 50s.
A Church still has tax exempt status, if they are not a 501 C 3, corporation of the State.
He was President begining with JFK's assasination 11/22/1963 until 1970 (I think).
He didn't get any laws passed to directly limit pastors ability to advocate for candidates, they can do that even today. They just don't get to keep their 501c3 tax exempt status if they do.