They are very close; he picks a fight with the stronger Alan Ervin for her, and only gives away her secret after a huge beating. For him, it is not the beating that causes him so much pain, than the pain of self-contempt, of having given her secret away. He even tells the inspector a bit of what he thinks about Sophie being a mutant. Though David is not seen thinking about her later in life, his brief friendship with her has a huge impact on him. His conversation with the inspector is the first time his views have differed from those that he has been taught. Till the very end, he refuses to accept that Sophie is the work of the devil. He also begins to realize the danger that he might be in if found out. If she could be treated the way she was, so could he. Therefore, indirectly and directly, Sophie plays a huge part in helping David's views evolve and change.
Another character who greatly helps shape David's views is Uncle Axel. He is David's best friend and confidante; and David looks up to him like a father figure; trusting him greatly and even telling him about his telepathy, something he had not told even Sophie. It is therefore not surprising that Uncle Axel's views greatly rub off on David.
Uncle Axel is different from other people; his views on the tribulation and the old people have been influenced by his travels as a sailor. He believes that if the old people were so great, why would God punish them by Tribulation? Therefore, should Waknuk society even try to be like them? It is his opinion that what makes a man a man is not his physical attributes, for everyone has different ideas on the True Image(as Repentances was written after Tribulation). What makes a man a man, is his mind. It separates and elevates him from the level of a beast, thus, as David has a new quality of mind, he might actually be closer to the "true image" than most people.
As David listens to these views, he agrees with most of them, as firstly they answer a lot of his questions, after the Sophie incident.
Indirectly or directly, Uncle Axel creates a lot of self awareness in David; awareness of the dangers of being found out. He warns David many a time, and by murdering Ervin he impresses upon David the importance of keeping the secret hidden. This, too, influenced David's thinking as it helped him separate himself from the other people, as well as recognize that society's views are really different from the truth.