connected the ECU gets a metered air signal, but it's bogus because the engine is getting tons of unmetered air from the vac leak, causing very rough idling, not running, etc. When you disconnect the MAF, the ECU has no choice but to use the 02 sensors to determine how much fuel to send to the engine to keep the A/F ratio correct (or close to stoich anyway). Thus your engine running better with the MAF disconnected.
You need to cap off your air intake where the filter is and pressurize your air intake system to listen/feel for vac leaks and fix them.