It could be the genetics themselves. Some are very prone to herm. Example, Sour diesel. The strain known around the world, is super hard to grow and Is very easily stressed and hermed.
Also if you have any hemp farms near you, or outdoor grows within a few miles.. bees could be bringing them to your plants.
If your buying weed that has seeds and are grinding with your hands I've heard it can transfer to yours and cause them to herm. True... idk?
Many things from environmental conditions based on the strain your growing some prefer warm some cold.. so on so forth. Learn the strain you have and get conditions dialed in if indoors.
If outdoors think about using a small make shift greenhouse to protect from bees pollinating yours and turning male.
Goodluck.
Please consider selecting me as answer so I can be eligible to win grower of the month contest.
Cheers 😃