Well, so when the first form of the fence went up, the Slovenian government claimed it was not intended to stop migrants, but only to direct them to the official entry points:
“The barriers do not have the purpose of preventing arrivals to Slovenia or significantly reducing them... Their purpose is to direct the flow of migrants to controlled entrance points,” Bostjan Sefic, state secretary at the Slovenian Interior Ministry, told a news conference. [...]
Slovenia’s boundary with Croatia will remain open, Cerar said, but the fence will prevent migrants entering the country at uncontrolled points along the frontier.
Croatians on their side of the border were doubtful.
By 2016, the justification [for continued construction] was a bit more straightforward:
an additional 40 km of fencing was constructed at the southern border along the Kolpa River. "Illegal border crossings must be prevented," the interior ministry said in a statement.
Also, in March 2016, Slovenia closed its border, prompting what was called a "domino effect" in neighboring countries, e.g. Croatia declared it would only admit people with valid visas thereafter. (Human rights organizations have since accused Slovenia of "massive and systemic denials of asylum rights and collective expulsion to Croatia", like 26,000 alleged "push-backs". Croatia was accused of pretty much the same.)
As another 40-km section of the fence was completed in 2019, Reuters reported
"a jump of 56% compared to the same period of 2018" in illegal migrants entering Slovenia.
(I'm guessing this was part of the official reasoning for continuing the works, although
that's not made explicit.) In this story, Reuters actually said the fence was now
219-km long, more than FRA reported a year later. Also, the fence is still only covering
a third of the Slovenia-Croatia land border, according to Reuters. Interestingly, the fence
was again being described as temporary by Slovenian government:
“The fence will be erected temporarily in the areas where it is necessary to prevent illegal crossings of the state border and ensure the safety of people and their property,” said Irena Likar, a spokeswoman of the Interior Ministry.