Iran announced yesterday it was formally canceling construction of a second gas pipeline to the Soviet Union, part of a complex project to provide gas to Western Europe.

The head of the National Iranian Gas Co., Hassan Morshed, said in a radio broadcast the the Iranian revolutionary government's policy was to stop gas exports and that the new pipeline, called the Iran Gas Trunkline-2, was being scrapped.

The $2.5 billion, 840-mile pipeline - part of a swap agreement under which Soviet natural gas would have been exported to West Germany, France, Austria and Czechoslovakia - was to have become operational next year. Construction work on the line stopped during the revolution, and cancellation of the project had been widely expected.

In his broadcast statement, Morshed also said Iran would ask the Soviets to pay more for Iranian gas supplied through an existing pipeline to the Soviet Union. The present price is $26 per thousand cubic meters.

Morshed added that Iran has decided not to revive plans to supply the Columbia Liquefied Natural Gas Corp., a subsidiary of Columbia Gas Systems, Inc. of Wilmington, Delaware, with liquefied natural gas over a 22-year period. Agreements on the project had been signed during the shah's reign, but they were effectively dropped before the revolutionary government took power.

Columbia Liquefied supplies about 6 percent of the gas supply of the Washington Gas Light Co., the Washington area's natural gas utility, but spokesmen for both companies said the cancellation would have no impact on area deliveries. A spokesman in Washington for Columbia Liquefied said the firm had signed a contract for the delivery of 175 million cubic feet of gas a day from Iran beginning in 1982, but had anticipated the cancellation.