The people at the Flesh Fair oddly enough, David (not really knowing any better on top of being scared) cries out that he's actually a real boy. His very believable cries of panic move the audience so much that they all step up to defend him from Lord Johnson Johnson and riot.
The film itself is Spielberg's tribute to his deceased friend. He kept the controversial ending in the movie because that was how Kubrick planned it, and he wanted to keep the movie true to Kubrick's vision.
Joe and David looking out for each other throughout the film, despite their respective programs posing the practical impossibility of them understanding what drives one another.