The court also entreated the government to abolish part-time schools for pregnant school girls which rights campaigners have described as "discriminatory."
According to an advocacy group, Equality Now, Sierra Leone started recording high teenage pregnancy rates linked to the closure of schools during the Ebola crisis.
In 2015, the Sierra Leone government adopted a policy that barred pregnant girls from attending mainstream school. The group said that the government set up specialized centers for pregnant students.
In an interview with CNN, Judy Gitau from Equality Now said "a girl cannot get pregnant on her own in the first instance. Also, many of these girls come from poor families, and once they lose a year, they will not return to school."
Acting Deputy Director Campaigns of Amnesty International West and Central Africa, Marta Colomer, said the judgment was a "landmark moment" for many girls who were denied inclusive education because of the ban.
She was hopeful that this ruling will convince other African countries in similar situations to reverse their decisions.
"This also delivers a clear message to other African governments who have similar bans, such as Tanzania and Equatorial Guinea, or maybe contemplating them, that they should follow this ground-breaking ruling and take steps to allow pregnant girls access to education in line with their own human rights obligations."