It is necessary to first establish what David's moral values are so that his decisions can be seen to accord or to conflict with these values. Also, as you'll see, there are two levels of a person's moral values. They are the values a person is taught by family and/or school and/or society [note: these may not accord with each other!] and the values springing from one's own inner character. Briefly, in David's case, he was taught by father, school, and society that rigid conformity to strict and unyielding rules that punish "deviance," which is physical, psychological, emotional, or intellectual departure from a sternly defined norm, is to be brutally punished and eradicated--utterly destroyed. This is reinforced with slogans like "The Devil is the Father of Deviation."
One decision David makes that conflicts with the moral values he has been taught--his public values--is to keep Sophie's secret about the deviance of her toes a secret--even at the price of severe punishment. On the other hand, this decision accords with his private values that only emerge and reveal themselves as he acts from inner impulses as events come upon him. Therefore, while David's decision conflicts with his public values, it accords with his private values, which are values he couldn't have known he had until that event occurred. Another decision David makes that conflicts with the values he has been taught is his decision to keep a secret with Uncle Axel about David's own secret related to his cognitive powers. He simultaneously makes another decision that conflicts with his public values and that is to keep the secret of his friends' similar cognitive deviances.
"Wouldn't it be more fun to do your chattering with some of the other kids .... than just sitting and talking to yourself?"
"But I was."
"Was what?" he asked, puzzled.
"Talking to one of them," I told him. ...
"Rosalind," I told him. ...
"H'm -- I didn't see her around," he remarked.
Secrets are against the moral values of the community since secrets may hide deviance and secrets about deviance are paramountly against the moral values of the community since all deviance must be destroyed. However, this is another instance when David's decision accords with his emerging private moral values just as his decision to protect Sophie did. Two things that clearly emerge from examining some of David's decisions and how they conflict with his moral values. The first is David has two sets of moral values and they conflict against each other. The second is that David follows his emerging private values at great risk and personal hardship thus causing greater conflict with his taught moral values.