WASHINGTON— A major spending plan unveiled by congressional lawmakers late Tuesday restricts the Securities and Exchange Commission from forcing public companies to disclose their political activities.

The provision, tacked on to a $1.15 trillion spending bill for fiscal year 2016, is a blow to liberal groups and many congressional Democrats who have long pushed—unsuccessfully—for the SEC to advance such rules. It is one of the few Republican-backed measures, known as “riders,” included in the legislation. The legislation...