I’d argue the more C3PO lives and learns, the more personable he becomes and develops what could be seen as emotions.
More or less his experiences are what influences his opinions on certain situations, and those opinions could be seen as him having emotions.