At that time in Ireland, hospitals were run by the Catholic Church, which had a huge influence on all aspects of society. Although the primary purpose of a hospital is supposed to be make sick people better, the nuns in charge are keen to make sure that their rigid interpretation of Catholic dogma is still strictly adhered to at all times. In laying down the law, Sister Rita makes it perfectly clear that there must be no fraternization between the sexes, so Frank and Patricia must not be allowed to talk to each other under any circumstances. Sister Rita is clearly worried that some kind of sexual impropriety might follow if the two are allowed to converse.
There are good clinical reasons to prevent the passing of items between the typhoid ward—where Frank is staying—and Patricia's diphtheria ward; deadly germs could so easily be transmitted. But Sister Rita's ban on any talking between Frank and Rita has more to do with upholding her narrow interpretation of the Church's moral teaching than preventing the spread of infection.