Fannie Mae and Freddie Mac’s regulator appears to have learned that it’s best to be careful when making comments about freeing the mortgage giants from federal control.

Joseph Otting, the acting director of the Federal Housing Finance Agency, made clear Feb. 7 that it’s the Trump administration’s preference to work with Congress, after he faced a backlash last month for privately hinting the FHFA and Treasury Department might circumvent lawmakers.

Otting’s January comments that caused a stir, made in a meeting with FHFA staff, were secretly recorded and leaked to the media. The remarks triggered a surge in Fannie and...