Some very general thoughts about how the concepts of gender and sexuality and sex apply to Programs (under a cut for a little spiciness):
A Program's gender is typically defined by how their User identifies at the time they're written, and most will default to the pronouns and gender presentation of their User. In that sense, gender is a very loose concept to most Programs. It has no bearing on their societal structures and cultural norms.
For the sake of making any of this comprehensible I'll keep using the terms gender and sexuality, but just know that the words themselves probably won't mean anything to Programs. Ram only has a vague understanding of the differences between men and women based on the fact that gender can factor into insurance rates.
Programs don't have any primary sex characteristics (i.e. genitals or reproductive organs). They can't reproduce -- and unless they're familiar with User biology most of them probably don't even know what reproduction is -- so that would just be a lot of extra bits and pieces. It's Barbie / Ken doll anatomy under all that digital spandex, sorry. But this also ties into why gender isn't much of a Thing for Programs beyond some secondary sex characteristics and other variations in appearance.
There is an understanding that certain aesthetic features of one's render can be tied to gender. Programs can't completely rewrite themselves but can make cosmetic adjustments to their appearances. They can change their hair color and the circuitry patterns of their base layer suits, or add outer layers of clothing -- on Flynn's Grid, anyway, where Programs generally have a little more freedom outside of their functions. Changing one's render entirely is possible, at least in a temporary way that needs upkeep and refreshing (see Keller). Opposition to this comes only from rare and traditional Programs, who would decry any alteration to the image of one's User.
Attraction comes in many forms, just as it does for Users. Some Programs will only have an interest in those they're created to be linked to. The term "bonded pair" is used a lot in Tron fanwork and I don't have a strong enough opinion on that to call it something else, so we'll stick with it. For Programs who don't have a bondmate, attraction might still be based on functional compatability -- or it might be based on personality, physical features, etc.
It doesn't necessarily follow that a User's sexuality will dictate their Program's sexuality, either. Roy, for example, is very confidently aromantic and asexual. Ram is aesthetically and physically attracted to those with "masculine" or "male" features -- gay, by User standards.
Which brings us to the spicy time topic of how Programs have sex. And the long and short of it is... they don't, in User terms, because they don't have the parts for it. It's all circuit based. Programs can communicate through touch and energy exchange, among other methods (that's a whole other post), and the intent behind the contact determines how it's received. For them, "sex" is a matter of energy exchange with an intent to arouse. And you tend to get back what you give. Circuit stimulation is how that energy is conveyed. Or, y'know, frottage, to borrow the Ao3 tag.
Different Programs might have specific erogenous zones on their circuitry, but that's an individual thing. Circuits around the upper back and shoulder blade area, where a disc would sit, are common hotspots. Skin-layer circuitry under their base suits -- which, yes, can be partially or completely removed or derezzed -- is more sensitive than anything on a clothing layer.
Circuits flush purple when a Program is aroused (and that's canon baby!)