Many cultures of the past were quite comfortable with homosexuality. Homosexuality was thought of as quite normal in feudal Japan and ancient Greece, for example. It was the wave of Christianity that brought with it taboos against same-sex relationships.
We will of course never know for sure if Leonardo Da Vinci was straight, homosexual, or any combination of the two. There is no "proof" left behind for us. However, Leonardo never married. He never had any female partners that were of note. He was an incredibly handsome and popular man, sought after by courts and patrons. He had no lack of interested females in his social group. He chose to ignore them.
Some say this is a self portrait of Leonardo Da Vinci, while others say it is not.
On April 8, 1476, an anonymous person brought an accusation to the church, claiming that Leonardo Da Vinci was having homosexual relationships with some of his students / companions. At the time, Leonardo was just turning 24. The explicit charge was that Jacopo Saltarelli, one of Leonardo's male models, was also his lover. As the consequences would have been quite harsh for Leonardo, he and the other accused individuals fought the charge and were acquitted. Leonardo had many powerful friends, even this early in his career, who helped him clear his name. He was put in prison for two months during this time.
It is interesting to note that Leonardo had several "close male companions" but never was linked to or married a woman. Leonardo was a great believer in Humanism - that human beings could choose for themselves what was good or bad and did not need to follow strict teachings of the church to find their path in life.
In 1502, Leonardo worked for Cesare Borgia for a short period of time. Cesare is famous as the conniving ruler used as the model for "The Prince" by Machiavelli, a treatise about how to keep power at all costs. Leonardo quit this job after only 9 months, apparently because his good friend Vitellozzo Vitelli was ruthlessly murdered by Cesare.
In 1507, Leonardo begins working for King Louis XII of France, keeping Milan as his base of operations. One of his favorite students was Francesco Melzi, who joined Leonardo at age 17. Franceso remained with Leonardo up until Leonardo's death.
While Leonardo did paint females in the course of his duties, most of his personal sketches involved nude male bodies - not females.