Sheldon V. Ekman, 61, a judge of the U.S. Tax Court, died at Metropolitan Hospital in Philadelphia Monday after a heart attack.

Judge Ekman, who had lived in Washington since he was appointed to the court by President Carter in 1980, was in Philadelphia to hear a case when he was stricken.

He was born in Manchester, N.H., and earned his undergraduate and law degrees at Harvard University. After World War II service as a Naval officer, he became a trial lawyer in the office of the chief counsel of the Internal Revenue Service in New York City.

In 1950, he joined the New York accounting firm of S.D. Leidsesdorf & Co. as its tax principal. In 1969, he became a partner in the New York law firm of Reavis & McGrath. He remained there until he joined the tax court.

Judge Ekman, who lived in Westport, Conn., before moving to Washington, was a member of the advisory committee of the New York University Institute on Federal Taxation. He also lectured there and at several other tax institutes. He published papers on his specialty in numerous professional journals.

He was a member of the National Lawyers Club in Washington and the Harvard Club of New York City.

Survivors include his wife, Judith, of Washington; a daughter, Joanna, of New York City; a son, Richard, of Hiram, Ohio; two sisters, Arline Eman of Waltham, Mass., and Rosalind Ladd of Providence, R.I., and one grandson.