PHILADELPHIA (AP) _ A hospital ignored state laws that encourage ''good Samaritan'' acts by firing a dormitory housemother who gave shelter to a battered wife, a lawyer argued Monday.

The former housemother, Sallyanne Brown, is seeking unspecified damages and back pay from Northeastern Hospital in a civil lawsuit that went to trial Monday in Common Pleas Court.

Mrs. Brown testified that she was fired from her part-time job as housemother at a dormitory for the hospital's female nursing students after she opened the dormitory doors late one night to a woman who was crying that she had been beaten by her husband and needed the police.

Hospital officials testified that Mrs. Brown was fired for violating rules that prohibited her from doing anything that might endanger the safety of the dormitory residents, including admitting unauthorized visitors after curfew.

Mrs. Brown's lawyer, Judith Chomsky, argued that the hospital decision was based on an ''unreasonable'' fear that the woman posed a danger and that the hospital failed to give housemothers guidelines for handling emergencies.

During the opening arguments, Common Pleas Judge Lawrence Prattis said there was no question that state laws encourage giving assistance to abuse victims, but said that does not provide an excuse for violating rules established by employers.

When Mrs. Brown was on the stand, Prattis asked her if she would have let in a teen-age boy who came to the door with bruises and said he was abused.

Mrs. Brown said she would, to which Prattis replied, ''I believe you would.''

''And that, Ms. Chomsky, is your problem,'' the judge said.

Mrs. Brown also testified that a hospital security guard was present Dec. 13, 1987, when she let the woman in, and that the guard stayed until police came for the woman.

Dr. Shirley Hickman, director of nursing education at the hospital, said Mrs. Brown would have been disciplined regardless of whether a guard was present.

Ms. Hickman said the dormitory housemother has the responsibility for controlling who comes into the building after curfew, and that hospital rules prohibited the entrance of unauthorized people.

Ms. Hickman said she recommended that Mrs. Brown be fired because of the rules violation and because she no longer trusted Mrs. Brown's judgment.