He represented Massachusetts in the House of Representatives during the 1970s before stepping down when Pope John Paul II issued a directive barring priests from holding public office .