The passage of the Thaft-Hartley Act of 1947 contributed to the deelopment of McCarthyism.
The Thaft-Hartley Act was passed during the period known as the Second Red Scare (from the late 1940s through the 1950s). The passage of the bill can be interpreted as the business lobby response to the growing labor power and an attempt to desmolibilze the unions, socialist ideas and limiting their political power.
Also, the fear of communist ideas spreading in America and their power infiltraing the labor unions with political interests contributed to the requirement to sign non-communist pledges. According to these pledges, they stated that they didn't have any relationship with the Communist Party or any organization seeking the "overthrow of the United States government by force or by any illegal or unconstitutional means"
With the growing tensions of the Cold War in the following years led to the more radical prosecution of communist people an ideas and the period known as McCarthyism (1950-1956).