Inspired by this question. Are droids in the Star Wars universe referred to with gendered pronouns (i.e. he or she), or are they referred to as objects (i.e. it)?
Droids have personality, and that personality can be masculine or feminine.
R2-D2 and C-3P0 have (arguably) masculine personalities, either because they developed that way or they were initially programmed that way. Or, potentially, because I have a cultural bias that paints the actions of both as 'more male' than 'more female'.
Therefore it's not incorrect to apply gendered pronouns to them. 'It', however, would also be accurate.
Some droids, rarely referenced, are more appropriate to be called 'male' or 'female' due to...enhancements made to suit their primary purpose, but they are rarely touched upon even in the books.
There's more evidence that C-3P0 is male, quite famously.
According to the Star Wars: The Clone Wars Character Encyclopedia, droids can have programmed genders or no gender at all.
(apologies for the poor image quality, no apologies for the free-hand red circles.)
Therefore, a droid should be referred to as "he," "she" or "it" based on what gender (if any) it had been programmed to have.
The script refers to both R2-D2 and C-3PO as male, and although we don't know what R2 is saying in his dialogue, we do hear 3PO refer to R2 as a male on several occasions.
An explosion rocks the ship as two robots, Artoo-Detoo (R2-D2) and See-Threepio (C-3PO) struggle to make their way through the shaking, bouncing passageway. Both robots are old and battered. Artoo is a short, claw-armed tripod. His face is a mass of computer lights surrounding a radar eye. Threepio, on the other hand, is a tall, slender robot of human proportions. He has a gleaming bronze-like metallic surface of an Art Deco design.
THREEPIO That malfunctioning little twerp. This is all his fault! He tricked me into going this way, but he'll do no better.
There are definitely droids that have an apparent gender.
There are definitely droids that have no gender as well.
Star wars. I'd say a lot of the droids there have no personality, limited personality, or hidden personality. Either way, they definitely look androgynous.
There's a cultural bias, that when a AI expresses a personality that has neither masculine or feminine traits, they are seen as masculine anyway. See R2-D2.