I think part of why A.I. remains divisive is the gap between what David understands to be happening and what we actually see. That's especially true at the end, but that gap is intentional: "I thought this would be hard for you to understand. You were programmed to be so young."
I do think it’s funny whenever people think the ending of A.I. is happy when it’s arguably way more fucked up than if David just got left at the bottom of the ocean