Question: Assume this city is relatively large by late medieval standards, around 200,000 people. The city is mainly a site for trade due to its geographically central position and being on a river. Also, because it is geographically central, it also means the city is important for the government to project power.

**What might be the benefits for this same government to sanction certain crime within this important trade city?**

Crime that would be considered legal within city limits ranges from murder, burglary, trade of illicit substances, and racketeering. This is all under the condition that the crime does not directly affect the government's activities.

Answer: 
**In the real world, we sanction crime already**

Many countries allowed crime. Prostitution is illegal in many areas and has been at many times. It was and is often *tolerated*. Reasonings like, "if we don't tolerate it, the sailors will grab our woman of high social standing" were used to justify this. It was certainly still illigal, but as long as it wasn't in the way of society, it was ok.

This has happened in many other cases. Drug use for example. But there's also more difficult ideas like violence. Citizens, military and police all have varying amount of violence that is tolerated. Killing someone in self defence, or beating political rivals, or simoly killing an enemy all have different amount of tolerances. Violence in itself however is normally illigal.

Your government can use the same. Murder? Don't care. Murder of a policeman or factory worker? Illegal. As soon as the value to the city ramps up, the amount of tolerance will go down.
Hollywood will show you many - prolly dozens - of stories in which "governments" sanction crime for their own devious ends… most often to justify increasing the security budget or beefing up security powers.

That and any other Answer uses "government" in a rather loose sense. Even in today's Communist China and the historical USSR, it's almost unthinkable that an entire government would collectively go your way.

May we assume the Question is really about agencies, branches or departments, or rogue agents within them?