Ruling the nation afterward would only be moral if the intention of the ruler(s) was to help the nation get back on its feet so its people could begin to govern themselves, again. That would mean helping build up their economy and helping to prevent or remedy any famine as a result of the conflict, keeping doctors and nurses there to cure the sick and heal the injured, and prevent the spread of disease., and provide whatever other help is urgently needed at the time.
Once the vanquished nation has been restored, its government may be required to pay reparations to the victorious nation as compensation for causing the war, and to help restore the vast resources that would have been used to eliminate the threat. That would be fair, providing a workable arrangement was agreed upon that wouldn’t pose a hardship for the people of the nation that has just gotten back on its feet – an installment plan with reasonable payments over a reasonable amount of time, with provision for extensions should the unforeseeable happen that would cause the newly restabilized nation, through no fault of its own, to fall behind in the payments.
Once this has all been accomplished, the rulers should pull out and the new government of the conquered nation (which would then become a free nation again) sign a peace pact with the conquering nation so as to avoid future conflicts between them. This could take a very long time, but eventually, with the charitable help of the stronger nation, and with mutual cooperation, relations could improve and normalize once stability is regained.
Pie in the sky, perhaps, but that would be just and moral, in my opinion.