Why is ṣāliḥun masculine in jāʾat imraʾatun ṣāliḥun abūhā?

The Tawābiʿ and Naʿt: Direct and Relational Attributes