Trump harped on it with the whole "lock her up" stuff, again because it's politically advantageous. He reneged on it once in office, admitting he wasn't going to pursue any charges against her. It was probably calculated that doing so would be bad optics as using the justice system to go after the top candidate of the competing party would be considered divisive. It was also potentially unproductive as she had already lost. There's also the element of personal connection, Trump was an NY Democrat for decades and had known the Clintons personally. Their daughters had a friendship in the past.
Also see George Santos as a counterpoint. Fellow NY Republican congressmen went after him knowing that their party would likely lose his seat. Again, I interpret their actions as self serving, they wanted to distance themselves from his shenanigans to their own constituents and appear to be acting objectively rather than in the interest of their party but the right result was achieved regardless.