Lawmakers also passed one of Mr. Cuomo’s top priorities: structural changes to reduce billions in spending on the state’s growing Medicaid program, which the governor blamed for helping to create a projected $6 billion budget gap before the coronavirus outbreak hit New York.

The budget lifted a ban on paid gestational surrogacy, which failed to gain support in 2019 following opposition from some feminist and religious groups who argued that it commodified a woman’s body and would lead to the exploitation of poor women.

The legislation includes language requiring that surrogates have access to health care and legal counsel paid by the parents, as well as the right to decide whether to continue or terminate a pregnancy.

The environment was once again a hallmark of the budget: An act to leverage $3 billion in bonds to address environmental issues around the state was approved, as was a ban on single-use foam food containers, which are not biodegradable and difficult to recycle.

That provision was attacked as a job-killer by the American Chemistry Council, a major trade group for chemical companies, which noted that restaurants are now limited to takeout and delivery services. (The ban does not take effect until 2022.)

The measure followed a ban on single-use plastic bags passed last year that was supposed to go into effect March 1, but won’t be enforced until at least May 15 because of the outbreak.

Legislators also legalized electric scooters and bicycles, a reversal of Mr. Cuomo’s veto of similar legislation late last year because he had safety and implementation concerns.