Sexuality is neither a choice nor an inherited trait, but rather a product of an individual's own preferences, interests, sexual experimentation (if applicable), and sometimes even negative experiences with specific genders. Kind of like general personality and gender identity, there's no one specific reason.
Personally my entire family is very religious, no other non-straight non-cis people within my immediate family. I realized I was bisexual when I learned what it meant. I learned I was nonbinary when I had a word for that. Some people see it as a choice or change, whereas I just finally found a word to describe the way I'd felt for my entire life.
Actually one of the reasons I think there's so many LGBTQ+ people as compared to, say, 30 years ago, is just more media and communities and discussions like this. I didn't even know what bisexuality or transgender was until I was 16 yet it clicked with me immediately. I'd praise the internet for helping me find myself if it wasn't so terrible sometimes too, haha.