A broody hen is only bad if it is a trait you do not desire. When a hen is broody, her mama hormones are in full force and see wanting to hatch some eggs. If you are a commercial poultry farmer wanting eggs, this is poor business because she's not laying eggs for you to sell! Therefore, many breeds have been selectively bred so that they are unlikely to go broody. However, many heritage breeds, breeds that have deep historical roots, a breed you may go back in time and find in your great-great-great-grandparent's backyard scratching around. For a small farmer wanting a sustainable flock, broodiness may be a great quality! This means once or twice a year your hen will hatch more babies to add to your flock and you will have more fresh eggs or meat as you desire. So yes, broodiness is a genetic trait.
In my own personal life, I chose a mixed flock of commercial and heritage breeds. This spring 2 of 10 hens went broody and I was able to let one hatch her own babies! So you don't have to do one or the other (commercial breed vs heritage breed), you can choose a mix. If you are buying chicks from a hatchery, the description will list if the hen is prone to broodiness and you can use Google or BYC's
Articles for help as well.
You notice how I said 2 of my 10 hens were broody, but only one was allowed to hatch? There are ways to help a broody "snap out of it" and end the hormone cycle that is causing her to sit on eggs. Here is a great resource of the many ways to encourage her to stop:
https://www.backyardchickens.com/articles/ For the most persistent hen, she may need to be put in a separate enclosure with food and water and no nest box for 3-4 days before she is back to her old self, but often you can encourage her to call it quits without needing to go this far.