A judge ruled that a mentally ill man accused of setting fire to a Leominster restaurant in 2021 cannot be forced to take antipsychotic medication.