No, but if it were clear Moriarty were going to go out and kill people, and they let him go, it would make them responsible for everything he did.
It'd be like that episode of Stargate where they let Nirti go.
They wouldn’t necessarily have to “let him go.” If he can leave the holodeck, he can be put in the brig. Not indefinitely, of course, since I don’t think he has committed any crimes that would incur a life sentence in the 24th century UFP, but he could be held for a while, on charges of kidnapping and interfering with ship operations. Presumably, by the time the UFP rehabilitation center is through with him, he will no longer act as a villain, because in Roddenberry’s vision those rehab centers are presumed to work.
I categorically reject the contention that encountering a potential killer and not killing him makes one responsible for everything he does thereafter.