There were a number of important factors as well as failings of General Washington, his commanders, and his army that led to the eventual abandonment of New York to the British Army.
First, the British Navy had complete control of the sea and Washington had no idea where they would land. Manhattan Island was surrounded, of course, by water, and the British fleet could access virtually any point it wanted to. This made New York indefensible, which Washington knew, but he feared the Revolutionary effort might collapse if he made no attempt at all to protect the city.
Second, Washington's army, while certinaly full of heart, had little experience, and often times melted away in the face of British Army regulars. This happened several times on Long Island, where hundreds of his men were butchered or captured.
Third, inexplicably, Washington left a key pass from Long Island into the city undefended (while he did defend two others). This let the bulk of the British Army into the city and flanked Washington's forces still on the island.
Lastly, New York, quite simply, was not a revolutionary city. They remained largely loyalist, full of British merchants and those privileged elites the British had given the keys of the city to, so the redcoats did not lack for good intelligence, aided by the very residents of the city they were attacking.
When Washington struggled out of the city in haste, losing hundreds more men in the process, he was decidedly weakened, and the next six months of the war were the most difficult for him.