WASHINGTON (AP) _ A letter that John W. Hinckley Jr. wrote to obtain a nude sketch of actress Jodie Foster scuttled a mental hospital's plan to take the presidential assailant out on a field trip, according to sources familiar with the case.

Hinckley's correspondence with a mail-order house was discovered by the Secret Service after prosecutors found what they termed ''disturbing entries'' in Hinckley's treatment record at St. Elizabeths Hospital, according to sources who spoke only on condition they not be identified.

One source said Hinckley obtained the drawing of Miss Foster in the nude.

A recurring theme in Hinkley's case has been his obsession with the actress, who played the role of a prostitute in the movie ''Taxi Driver,'' which concerned a plot to kill a senator seeking the presidency.

Prosecutors contended that Hinckley shot President Reagan and three other men here on March 30, 1981, to impress Miss Foster. Hinckley, now 33, was acquitted by reason of insanity and was committed indefinitely to the Washington mental hospital.

Last year, pictures of Miss Foster were found in Hinckley's dormitory-style room at St. Elizabeths before hospital officials abruptly withdrew a request to allow him to visit his parents over the Easter weekend.

The search was ordered by a judge after a psychiatrist, Glenn Miller, disclosed in testimony that Hinckley had written to multiple murderer Theodore Bundy on Florida's death row.

During last year's court proceeding, Miller testified that Hinckley was no longer obsessed with Miss Foster, about whom he had made daily statements during interviews five years earlier.

But in psychiatric interviews last year, Hinckley appeared embarrassed when the subject of Miss Foster was raised and said his feelings about her had been mere delusions, Miller testified.

Miller said Hinckley talked daily in 1982 of killing himself and Miss Foster, but no longer confused the actress with her movie role.

In the latest episode, the correspondence about the picture of Miss Foster was turned over to hospital officials on Aug. 11, the eve of a court hearing on the proposal to take Hinckley on a field trip with other patients.

The next day, the hospital announced in court it was withdrawing plans to take Hinckley on the supervised outing after officials ''determined that further clinical assessment by Mr. Hinckley's treatment staff is necessary.''

Prosecutors are trying to persuade U.S. District Judge Barrington D. Parker to unseal the writings that were found by Secret Service agents.

''The public should be aware of what these materials are,'' U.S. Attorney Jay B. Stephens told reporters after the hearing.

Defense lawyers want to keep the material under court seal. In a court filing last week, they accused prosecutors of trying to ''inflame public passion'' against Hinckley.

Releasing the material ''might prejudice his rights to fair and impartial treatment of his illness in the future because of the potential unwillingness of both Mr. Hinckley and the hospital staff to deal with such a negative portrayal,'' the lawyers said.