Why issue medical insurance for foreigners entering the territory of Ukraine?

According to the legislation of Ukraine, it is MANDATORY to have a health insurance policy

The policy guarantees payment of the cost of emergency medical care to foreigners who are on the territory of Ukraine within specified limits.

An insured event is the receipt of medical assistance by the insured person in connection with an acute illness, exacerbation of a chronic illness, injury, poisoning or other accident during the period of validity of the insurance contract.