The referent is Judah. The feminine-gender pronominal suffix on זְנוּתָהּ and the verbs וַתֶּחֱנַף and וַתִּנְאַף do not preclude this interpretation.
Gesenius wrote the following on יְהוּדָה (yehuda),1
n. d. Teilung des Reiches: Reich u. Volk Juda (ersteres f. Jes 44 26. Jer 23 6. Ps 114 2, letzteres m. Jes 3 8 od. f. Thr 1 3),
after the splitting of the kingdom: the kingdom and the people of Judah (the former, feminine Isa. 44:26; Jer. 23:6; Psa. 114:2; the latter, masculine Isa. 3:8 or feminine Lam. 1:3).
Footnotes
1 16th ed., p. 289, יְהוּדָה (yehuda), 3.
In v. 8, יְהוּדָה (“Judah”) is explicitly identified as the sister of [the northern kingdom of] Israel, viz. אֲחוֹתָהּ (achota), “her sister.” Hence, both Israel and Judah are feminine in this narrative, being Yahveh’s wives.
But, the nearest antecedent to the pronominal suffix on זְנוּתָהּ is not Israel (from the first half of v. 8), but Judah (from the last half of v. 8). Hence, זְנוּתָהּ (“her whoredom”) refers to Judah’s whoredom, not Israel’s.
References
Gesenius, Heinrich Friedrich Wilhelm. Hebräisches und aramäisches Handwörterbuch über das Alte Testament. Ed. Bulh, Frants. 16th ed. Leipzig: Vogel, 1915.