Responding to petition filed after pregnant woman's cookies taken by hospital guard, ministry tells High Court new law only allows hospital staff to inform guests of rules at gates