Either she really, really, really does not want to go back to DC, hoping conservatives will abandon Trump over this and cause him to lose.
Or her husband thinks this will help him with pro-abortion women, who are 64% of all women, many of whom believe, incorrectly, that Trump would sign a national abortion ban.
Donald Trump officially supports the status quo ante to which the overturning of Roe v Wade has returned the nation, in which the individual states decide whether and to what extent abortion should be allowed.
His position is incompatible with Melania's uncompromising views, suggesting her timing of her announcement is designed to sabotage his campaign.