The Ethiopians are now being kept at a social protection unit and are undergoing medical check-ups.
Botswana Police spokesperson Near Bagali says the migrants were found during a stop and search operation in the north of the country.
"We intercepted a truck which was bound for the Republic of South Africa," he explained. "As the police were searching the truck, they found, at the back of the truck, in the trailer, a total of 40 people, males. During our investigation we arrested two suspects pertaining to this incident, two Zambians and a Zimbabwean."
The three suspects have appeared in court and will remain in custody.
In a video circulating on social media, the men and boys are seen without shirts, with some complaining of the heat in the enclosed container.
Willem Els, a security expert at the Pretoria-based Institute of Security Studies, says conflict in some parts of Africa is fueling human trafficking.
"The more unstable it is in the Horn of Africa as well as in the whole belt toward the Central Africa Republic, the more we see illegal immigrants moving down to South Africa," he said.
"And that actually causes a big problem for South Africa as we saw the minister of police who mentioned that many of these immigrants resort to crime and it’s very difficult to trace because they are not documented."
Smuggling migrants in truck containers is often fatal.
The International Organization for Migration in its recently released 2022 Missing Migrants report, notes that 14% of migrants' deaths are linked to hazardous transportation.
Last year, 171 migrants died in southern Africa, from accidents and hazardous transportation.
Migrants from the Democratic Republic of Congo accounted for 42% of the deaths, followed by migrants from Ethiopia at 21% and Comoros with 7%.