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.
As this NSFW photo attests to
scifi.stackexchange.com/users/656/Jeff
According to the Star Wars: The Clone Wars Character Encyclopedia , droids can have programmed genders or no gender at all.
For example: (apologies for the poor image quality, no apologies for the free-hand red circles.)
Male: Female: None:
Varied:
Therefore, a droid should be referred to as "he," "she" or "it" based on what gender (if any) it had been programmed to have.
scifi.stackexchange.com/users/51226/Rogue Jedi
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.
And later: THREEPIO
That malfunctioning little twerp.
This is all his fault!
He tricked me into going this way, but he'll do no better.
scifi.stackexchange.com/users/44025/Wad Cheber stands with Monica
FLO (WA-7), the waitress droid from Dex's Diner in Attack of the Clones, was obviously intended to look and sound female.
scifi.stackexchange.com/users/14851/Stephen
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.
scifi.stackexchange.com/users/3754/Lee Louviere
The obviously female ones shouldn't be called 'droids' anyway, assuming that the term is a contraction of 'android'.
Strictly speaking 'androids' are male and 'gynoids' are female, so they'd be called 'noids'.
scifi.stackexchange.com/users/3800/Alan B
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)?
Is a droid a ‘he/she’ or an ‘it’?
scifi.stackexchange.com
<star-wars><droids>
scifi.stackexchange.com/questions/7731
scifi.stackexchange.com/users/None/
The script refers to both R2-D2 and C-3PO as male, and we  hear 3PO refer to R2 as a male on several occasions. Some droids appear to have a gender, while others do not. Droids can be programmed with genders and can ever be designed to lean towards a specific gender or they can have no gender at all. There are cases of C-3PO refering to R2-D2 with male pronouns on a number of occassions.
It is a definite fact that droids can have genders programmed into them and can even be designed to work with certain gender coding. There a definitely droinds who have genders and droids who do not. These droids exist as there are references of C-3PO using male pronouns to refer to R2-D2