After getting beat up at the ballot box in the last two election cycles, San Francisco real estate interests made a comeback Tuesday as voters widely approved the rezoning of a huge waterfront property for development and rejected a new property transfer tax meant to curtail speculation and evictions.

With nearly all the votes counted, the Pier 70 measure, Prop. F, was up 72.3 percent to 27.6 percent. Prop. G, the anti-speculation transfer tax, narrowed the gap as the night progressed, but still lost 53.96 percent to 46.04 percent.

In a city where waterfront development proposals invariably become political brawls, developer Forest City took a different tack at Pier 70, spending three years meeting with neighbors before coming up with a project that had what most residents were looking for: ample affordable housing, plenty of open space, and heights that would not block views or cast shadows in the adjacent Dogpatch.

The project won the endorsement of every elected official in town, environmental groups such as the Sierra Club, and neighborhood coalitions including the Dogpatch Neighborhood Association.

In the end it paid off. The measure was on a way to a rout.

Proposition F would increase height limits from 40 feet to 90 feet on 28 acres of land at Pier 70, a 65-acre waterfront property that once was home to the largest shipbuilding operation on the West Coast. Under the plan, Forest City would build 90-foot structures on about 30 percent of the property, a combination of offices and housing. About nine acres of the property would be parkland, and the rest would be a mix of restored historic buildings and five- to six-story apartment buildings. “We are excited for the neighborhood and the city and ready to take the next step toward revitalizing Pier 70,” said Alexa Arena, senior vice president for Forest City.

About 600 of the project’s 2,000 housing units — about 30 percent — would rent for below market rate.

Much more controversial was Prop. G, an antispeculation ballot measure that would impose a gradual real estate transfer tax on any short-term flip. Prop. G was an effort to create an economic disincentive to investors who buy rental buildings, and evict renters before converting them to condos.

But in the end, concerns that real estate speculation is wrecking San Francisco’s neighborhoods was not enough to overcome homeowners’ fears of a major new real estate tax.

The antispeculation ballot measure would have imposed a gradual real estate transfer tax on any short-term flip — defined as a property between two and 30 units that is bought and sold in fewer than five years. If the resale had fallen within one year of the purchase, the tax would have been 24 percent of the resale price; at two years, 22 percent; at three years, 20 percent; at four years, 18 percent; and finally, at five years, 14 percent.

Right now, the city’s residential transfer tax rages from 0.5 percent to 2.5 percent, depending on the price of the transaction.

Local and national real estate groups spent heavily to defeat the proposition, led by an $800,000 donation from the National Association of Realtors, $170,000 from the San Francisco Association of Realtors, $425,000 from the California Association of Realtors Issues Mobilization PAC, and $200,000 from a committee set up by Pacific Gas and Electric Co.

Proponents of the tax say it would have kept speculators from flipping apartment buildings, especially rent-controlled units that are part of the shrinking affordable housing supply in San Francisco. The No on G forces say the measure would have punished ordinary homeowners who need to sell their properties in a hurry because of illness, job relocation or other reasons.

For pro-G forces, it was a campaign wrought with emotion. On Oct. 14, San Francisco Tenants Union leader Ted Gullicksen, one of the main architects of Proposition G, passed away unexpectedly. His death left supporters reeling but as determined as ever to “leave it all on the table,” said Quintin Mecke, who ran the Yes On G campaign. Prop. G volunteers spoke of “turnout for Ted” and “G For Gullicksen.”

A third real estate measure on the ballot also won handily, although it will have little meaningful impact. Prop. K, a policy statement meant to deal with the housing crunch, is a watered-down compromise of a much more aggressive and controversial proposal by Supervisor Jane Kim and some affordable housing advocates that ran into staunch opposition from Mayor Ed Lee and developers. It won 65 percent to 34 percent.

Prop. K will make it official city policy to construct or rehabilitate 30,000 new housing units by 2020, with at least one-third of those permanently affordable to low- and moderate-income households, and half within reach of middle-class San Franciscans.

J.K. Dineen is a San Francisco Chronicle staff writer. E-mail: jdineen@sfchronicle.com Twitter: @sfjkdineen