I think people are viewing the end from David's perspective. From David's perspective, he got to spend one last day with his mother and go to sleep. He got what he wanted, even if she wasn't the REAL Monica. From David's POV, it doesn't matter.
I do think you're right though, the future mechas were using him as a guinea pig. The ending is a little complicated, thematically, I think.
For me, the saddest part is when David falls asleep and Teddy is still walking around. David was basically Teddy's Monica, and now he has to live alone.
A.I. is a more interesting movie then a lot of people give it credit for.
The Future Mecha start out curious about their Human "ancestors". They setup David with the Blue Fairy then Monica to observe the affect of Human love. In so doing, they learn empathy and perhaps the possibility to fell love themselves (as evidenced by the tone of the narration, which is not cold and inhuman but shows that they understand and empathize with David's plight)