Calling the hazards to the state's "delicate ecology" too great, Gov. John Spellman today rejected an application to build a pipeline that would transport Alaskan crude oil from Washington's coast to the Midwest.

The 1,500-mile pipeline had been endorsed by both President Reagan and President Carter. Washington is the only state of the five-state pipeline route to Clearbrook, Minn., that has not embraced it.

Energy Secretary James B. Edwards, a strong proponent of the project, said he was "deeply disappointed" in the decision. "It is a sad day when a major energy project from which all Americans would benefit is denied to them," he said in a statement.

The reaction from Rep. Arlan Stangeland (R-Minn.), in whose state the pipeline would end, was stronger. "I am not buying Gov. Spellman's reasons and neither is anyone else from the Midwest," Stangeland said in a statement released by his Washington office. The congressman said he would introduce legislation to override the decision at the federal level on national security grounds.

A Department of Energy spokesman said there was "always the question of federal preemption" but declined to speculate on what action the administration might take to reverse Spellman's decision. "Litigation is the next step," said spokesman Jim Merna.

Spellman, a Republican, said, "No one should be surprised by my decision to reject the application of the Northern Tier Pipeline Company for permission of the state to build a crude oil pipeline across Washington." He said he could not allow the Puget Sound, "its delicate ecology or the economy and lifestyle it supports to become endangered."

Spellman rejected an appeal from union leaders in Washington to approve the project, which they said would create 3,400 jobs in a state where the unemployment rate is running at 13 percent. His announcement culminated six years of wrangling over the proposed pipeline and some 11th-hour pressuring from some of Reagan's Cabinet members, including Edwards, that he approve the project in the name of national security.

The administration says the unstable situation in Central America opens the possibility of a cutoff of oil shipments through the Panama Canal. The need for the northern pipeline "has never been more obvious," Edwards said today.

Northern Tier, a consortium of oil, steel, rail and electrical firms, had asked for permission to build a $2.7 billion oil terminal and crude oil pipeline from Port Angeles, near Washington's coast, under Puget Sound and across the state to the Idaho border. The oil would flow eastward from there through a 42-inch pipeline through Idaho, Montana and North Dakota to oil refineries in Minnesota.

Company spokesmen said if Spellman had given the project the go-ahead, construction would have taken 2 1/2 to 3 years, and the pipeline would have been opened by the spring of 1985.

Spellman said that 30 miles of the pipeline would flow under Puget Sound and the above-ground route would have crossed areas with a history of earthquakes and landslides.

Cortlandt Dietler, chairman of the Northern Tier board of directors, said the company "regrets" Spellman's decision.

"Northern Tier reiterates its conviction that the pipeline is needed, that it can be built in a safe and environmentally acceptable manner and that it should be built," Dietler said.

In his announcement yesterday, Spellman also rejected Northern Tier's proposed oil loading port at Port Angeles, a small mill town at the foot of the Olympic Mountains.

But he said his decision does not rule out the possibility of another oil pipeline route elsewhere in the state.

"It is possible that a proposal for an all-land route originating at an oil port west of Port Angeles or another well studied and well engineered proposal could receive favorable consideration. I have rejected only the proposal before me," Spellman said.

Dietler said Northern Tier is not about to give up on the project.

"Having so far invested six and a half years of work in trying to gain approval of the project and with 1,400 permits issued, and only one to go, Northern Tier does intend to continue its endeavors," he said.

Spellman's decision came two months after the state's Energy Facility Site Evaluation Council had recommended he deny the application. Spellman had said before the council ruled he would probably abide by its decision unless it was "outlandish."

"Despite extraordinary attempts to apply pressure to me, I have avoided communications and kept my own counsel," the governor said yesterday. He referred to pressure applied by members of Reagan's Cabinet to approve the project. Interior Secretary James G. Watt visited Spellman here in February but Spellman emerged from that meeting declaring, "My arm is not twistable."

Later, Edwards urged Spellman in a letter to approve the project "for national security reasons."

Norma Turner, the Port Angeles housewive who led the crusade against the oil port, said she was "delighted and amazed" with Spellman's decision.