To know the answer of worshipping Shami trees on this day we need to refer the Mahabharata.
The Pandavas lost to the Kauravas in a game of dice and consequently they were banished from the kingdom to live in a forest for 12 years and then remain incognito for one year.
After completing 12 years of exile, the Pandavas decided to remain incognito in the kingdom of Virata, disguising themselves for the next one year. Before approaching the king, they wrapped their divine weapons in a cloth and kept it on a high branch of a shami tree near the cremation ground outside the city.
According to the Mahabharata, it was on the day of Vijaya Dashami that they successfully completed their one year of incognito life. Arjuna collected the weapons from the shami tree and defeated the Kauravas who attempted to steal the cattle of King Virata.
Since that day, shami trees and weapons have been worshiped on the ninth day of Navaratri (a day before Vijaya Dashami) symbolising this particular incident in the Mahabharata