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: 
Nonsense. If something is allowed by the law, then it is not a crime. The very definition of a crime is breaking the law.

The proper question would be why the law in this city is more lenient than elsewhere. Consider for example the US, which is probably the country with the most legally heterogeneous country in the world. In some places you can walk around with an assault rifle or drive a tank. Do it in other places and it's jail for you. Why? Because different places have different populations with different world views, and the government at federal level does not want or cannot interfere.
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?