The Talmud in Gittin 88a says that Israel was only destroyed once it had seven courts that worshiped idols. It proceeds to list seven different Northern Kings.
Rashi explains that the Kings of Judah aren't mentioned, because they were in the days of the Kings of Israel and are considered like one court.
I examined Kings and Chronicles, and it seems that up until Hezekiah, when Assyria exiled the Northern Kingdom, there were 7 rulers of Judah whose reigns could have contained idol worship: Rehoboam, Abijam, Jehoram and Ahaziah (v.16 & 25), Athalia (v.3), Jehoash (v.17), and Ahaz. The numbers work out pretty1 well, but the Kingdom of Judah wasn't destroyed by Assyria. In fact, one of our most righteous kings, Hezekiah was in power during and after the last King of Israel's reign, and the Kingdom of Judah itself wasn't destroyed for over a century2!
Furthermore, the Midrash Aggadath Breishith says in ch.48 that there were 7 wicked kings in Judah: Jehoram, Ahaz, Joash, Menashe, Ammon, Jehoiakim, and Zedekiah. This completely contradicts my reasoning above, and further complicates Rashi, because four of the seven wicked kings of Judah reign after the Assyrian exile!
Why does Rashi include the Kings of Judah in the Talmud's saying?
1. Amaziah was rebelled against by the people when he turned to idols (v.27), so I didn't count him, as he may not have been able to establish a court. Alternatively, you could count Amaziah but exclude Athalia, who may have had the same court as her grandson Ahaziah, as she pushed him toward idolatry in the first place (see citation above). I counted Abijam as separate from Rehoboam his father, because he seems to have a period of righteousness in his reign (see also Seder Olam Rabba 16: Rhoboam and his sons were righteous for 3 years, rebelling on the fourth). Athalia used Ahazia's reign to seize power for herself, so I assumed she made her own court too, and I separated Jehoram and Ahazia.
2. Based on Kings II. Hezekiah's rule began in the 3rd year of Hoseah's. Hoseah reigned for 9 years total, So of Hezekiah's 29 years, 23 of them were after the exile of Samaria. Menasseh- 55 yrs. Ammon - 2 yrs. Josiah - 31 yrs. Jehoahaz - 3 mnths. Jehoiakim - 11 years. Jehoiachin - 3 mnths. Zedekiah - 11 yrs. Gedaliah - less than 2 mnths. 23+55+2+31+11+11+JJ&G= roughly 133.