Its possible that David had his own personal ephod similar to the priest, that he had made for himself, that was blessed of Yaoh. Gideon from the judges made his own ephod. Plus david had the intuition to eat the show bread and it was not counted as sin towards him. Plus he was on the run as anointed king, while another king was ruling. And was it not the same priest who gave him the show bread, gave him the sword. What else?