The information above is all generally correct. A few comments:
1) While it is "mandatory" to live in the housing, they are willing to consider extenuating circumstance. For example, a resident who graduated 2 years ago lived in the suburbs with his wife & 4 children.
2) Pets, spouses, and children are definitely allowed.
3) In general, the housing is an excellent perk of the program. People who have experience living in or trying to find an apartment in NYC are the most impressed with the arrangement.
4) Apartment allocation is controlled by a housing committee made up of residents, so it is a more equitable and friendly process than the typical housing lottery. Given reasonable expectations (single interns live in studios, married residents live in 1 bed room apartments, senior residents with children get 2 bedroom), everyone has been satisfied.