Allah’s Order To Bani Israel To Fight
My guess would be that Allah knows the future. He knew that they will never convert or prophet Musa’s people will not fight. It is similar to the story to Khidr and prophet Musa where Khidr Alaih Salam killed a child; knowing the future of the child and guidance from Allah.
If you read the Bible it says that Allah wanted to punish these nations for their wrong doings. They had reached the point of no return. Also these areas are to be allocated to bani israel by God and they were entitled to get them.