A federal judge, casting a shadow over deregulation of the banking industry, ruled yesterday that plans to remove interest rate ceilings on some savings certificates were illegal.

U.S. District Judge Gerhard Gesell struck down a June decision by the Depository Institutions Deregulation Committee abolishing interest rate ceilings on certificates of deposit of four or more years, effective today.

The committee, which is headed by Treasury Secretary Donald Regan, took the action as the first step toward eliminating all interest rate ceilings by 1985. Gesell's action makes the speed of future deregulation uncertain. The DIDC said yesterday that it will appeal Gesell's ruling.

The DIDC move was opposed by the U.S. League of Savings Associations, a trade organization, which brought suit against the committee for violating a 1975 law that says the interest rate differential must be maintained through 1986 unless Congress acts to remove it.

"It is rare that Congress speaks in such unmistakable terms," said Gesell. He did, however, despite the league's protest, permit the removal of the 12 percent cap on 2 1/2-year certificates and to allow the rate to rise to 15.15 percent. A differential in favor of thrift institutions is built into this change. The league had argued that the change would cost its members billions of extra dollars over the new few years.

The ruling calls into question the ability of the DIDC to speed up the deregulation process, a declared objective of Regan and committee members Paul Volcker, chairman of the Federal Reserve, and Lawrence Connell, head of the National Credit Union Administration. Since the DIDC was formed last year, the league has fought it continuously because the regulators are committed to faster deregulation of the industry than the league contends that Congress intended. Last year, the league sued the DIDC on the same principle -- retention of the differential -- but lost just last week when another judge decided not to rescind the DIDC's action.

The league's executive vice president William B. O'Connell declared yesterday, "We're pleased that the court saw it our way." James L. Harris, president of Washington Federal Savings and Loan Association, stated, "I'm glad; deregulation was going much too fast. S&Ls can afford to pay these new high rates." Margie Muller, speaking for Union Trust Co. in Baltimore, expressed "disappointment at the last-minute decision."

A survey yesterday by The Washington Post of 28 metropolitan banks, savings and loans and credit unions showed that half were set to offer the new certificate, familiarly known as the "wild card" certificate because of the competition it will generate.