A senior Treasury Department official announced his resignation after being hounded by Elon Musk's DOGE allies.