The king in Matt 18v34 acts most cruelly by sending servant X to torture chambers. Servant X only sent servant Y to prison. The king failed to follow the advice of Matt 18v22 to forgive 70 * 7. The King failed to heed the advice in Matt 5v22 anyone who is angry with his brother will be subject to judgement.
In any case the King does not do the most clever thing which would be something like looking at the reasons for the debt crises and trying to find solutions. The king should have sent in a business expert and trained up both X & Y into how to run a profitable company. The king should have restructured the debt so that they could both keep working and paying. Maybe Y could have done some work for X to repay what was due.
In the end the King, V34 commits a crime against humanity by torturing X. Why did the King let the debt of X get so large ? Why did the king not investigate the case and find out the Y owed X. Maybe there were other people who owed X. Maybe X & Y were suffering ill health or a downturn inthe economy?
The passage is only an example in poor management of a difficult situation. However maybe prison is a valid option to try to influence people into paying proper taxes. But if you believe that people should be treated well then the kings use of torture must be condemned