It was a shrewd move. The Democrats have been saying for weeks that they'd negotiate in good faith if Trump agreed to reopen the government (even though Pelosi has explicitly stated that she would not ever agree to fund a wall.) This puts the onus on the Democrats when they refuse to compromise and the government shuts down again. Trump will beat the drum that he was ready and willing to talk, and that the Democrats lied, yet again, about being willing to negotiate and lied, yet again, about being serious about protecting the country.
He's doing what he does: Allowing the Democrats to make themselves look like dishonest irrational morons.