Using the US government as an example: There are agencies and functions which exist within the Executive Branch of the government whose purposes are to perform certain intelligence gathering operations which may violate US law or which may create embarrassment for a sitting administration. These agencies and functions thus operate under "black budgets" and are only peripherally connected to the government for reasons of national security.
In the Men In Black universe, it is made clear by statements and the use of the Neuralizer memory erasing devices that the existence of alien life is not known to to the general public. To maintain this facade, the government seems willing to extend certain law enforcement and intelligence powers to the MIB (arrest and detention powers, intelligence gathering, the use of deadly force, etc) while allowing the agency to operate outside of normal and legal channels.
This is probably for reasons of "plausible deniability" (e.g. if asked under oath if the agency exists, then a government official can truthfully state that it does not without incurring perjury charges) as well insulating MIB's operations from legislative oversight and media scrutiny.
The government may be "involved" in some aspects of the MIB program (in the first film military officers are shown as being tested for candidacy with the agency, for example) however, it seem to keep the agency's daily activities at arm's length and its very existence is likely only known to a select few people for reasons of security and deniability.