first samuel 22:9-10 suggests that the priest inquired of the lord and then gave the provisions, so the act was appropriate.
David received legally prohibited bread for his troops and was not judged negatively for it.