Do companies std test their new employees?

My bf recently started working at a construction company. First they did a drug test and then they took blood samples. He says it was for std testing but are they even allowed to do that? I’ve never heard of a company doing that..