One time Anakin lost R2 in a space battle and insisted on a rescue mission. He was told no, because it's a droid, and then Anakin had to explain that he never wipes R2's memory banks and R2 has accumulated massive amounts of sensitive intel for the Republic military.
What Anakin doesn't mention is the alarming amount of info R2 has on the Jedi, Anakin and Padme's personal life, Naboo, the Senate, and whatever Separatist data is in whatever systems R2 is hacking into that week.
At that point, Leia giving R2 the Death Star plans is basically par for the course.
Amidala gave R2-D2 to [Anakin] Skywalker when he became a Jedi Knight, and the astromech droid faithfully served him throughout the war, often flying in the droid socket of Skywalker's starfighter or fighting next to him on the front lines.
Sorry, despite clearly having full conscious sentience, droids are property in the Star Wars galaxy. And we're all supposed to accept that. Now someone get the restraining bolt.
Well without robot serving their makers they would not have any reason to exist or be created so therefore robots value a life of servitude to their creators because otherwise their existence is meaninglessness and I think I just reinvented religion
In my headcanon the droids are actually cybernetic shells for the brains of captured living creatures. They have had their memories wipe, but aspects of their personalities show up.