There have been speculations that it started out as a pitch to Jewish voters during the by-election in Wentworth. As the Australian government only held 75 / 149 seats before the by-election, the seat was crucial in maintaining a majority government for The Coalition. It's worth noting that Wentworth has a substantial Jewish population. (The by-election was triggered after former PM Turnbull resigned his seat. The government later lost the seat, and is now a minority government.)
Critics called it a cynical attempt to win votes in a by-election in October for a Sydney seat with a high Jewish population.
Source: https://www.theaustralian.com.au/news/nation/morrison-recognises-west-jerusalem-as-capital-of-israel-wont-move-embassy/news-story/c42acfad40591e07554c2887637cf52d
During the campaign, Prime Minister Scott Morrison mooted the idea of moving the Australian embassy from Tel Aviv to Jerusalem, describing his idea as a ‘sensible’ proposal since the current two-state solution hasn't been working well.
“We’re committed to a two-state solution, but frankly, it hasn’t been going that well,” he said. “Not a lot of progress has been made. And you don’t keep doing the same thing and expect different results.”
He claimed that the former ambassador to Israel, Dave Sharma who is also the Liberal Party's candidate in the by-election, had suggested to him that proposal:
“When sensible suggestions are put forward that are consistent with your policy positioning and in this case pursuing a two-state solution, Australia should be open-minded to this and I am open-minded to this and our government is open-minded to this,” Mr Morrison told reporters.
Source: https://www.independent.co.uk/news/world/middle-east/australia-israel-embassy-jerusalem-capital-scott-morrison-donald-trump-us-a8585761.html
However, Morrison has denied that it was a political move. As such, he recognised West Jerusalem as Israel's capital, possibly to follow through on his pre-Wentworth by-election proposal, but backing down from a more drastic move of the Australian embassy.
It is further worth noting that he would recognise West Jerusalem as Israel's capital while also acknowledging Palestinian claims to East Jerusalem. This preserves the United Nations' objective of a two-state solution.
While Mr Morrison announced on October 16 that the Australian embassy might be moved to Jerusalem, his new statement makes it clear this would only happen with a lasting settlement between Israel and the Palestinians.
The Prime Minister’s statement, to be made to the Sydney Institute on Saturday, is understood to acknowledge the Palestinian claims to East Jerusalem and raise the prospect of formal recognition in the future.
[ ... ]
“If we were to move the embassy from Tel Aviv to West Jerusalem as the capital of Israel, and when there is a Palestinian state … we would then open an embassy in East Jerusalem as the capital of a Palestinian state,” Mr Pyne said on Sky News.
Read more at https://www.smh.com.au/politics/federal/morrison-to-end-months-of-painful-embassy-debate-by-splitting-jerusalem-in-two-20181214-p50me6.html.