Basically, as the article you mentioned explains further, it's part of the Putin-era effort to [re]glorify the Stalinist legacy, and in particular the WWII aspects thereof.
Also, the trend appears to have been exacerbated by the post-2014 events (standoff with the West over the Crimean annexation etc.)
The re-evaluation of the Molotov-Ribbentrop pact began as early as 2005, when Putin compared it to the Munich agreement and accused the Baltic states of attacking Russia “to cover the shame of collaborationism”. By 2007, as Russia clashed with Estonia over a bronze statue to a second world war soldier, Russian historians were increasingly publishing books and essays defending the pact as expedient.
But praise for the treaty really escalated after Russia’s annexation of Crimea in 2014, when Moscow compared far-right support for Ukraine’s revolution to Nazi-era collaboration. The following year, Vladimir Medinsky, the country’s culture minister, called the treaty “a great achievement of Soviet diplomacy”.
There's an older 2015 article that puts in some perspective Putin's change in emphasis.
Russian President Vladimir Putin defended 1939's Molotov-Ribbentrop Pact between the Soviet Union and Nazi Germany as Moscow's response to being isolated and having its peace efforts snubbed by Western nations.
At the close of his Sunday meeting with German Chancellor Angela Merkel in Moscow — a day after Russian held grand-scale celebrations of the allied victory in World War II — Putin offered a lengthy defense of the controversial agreement that led to the carving up of Eastern Europe.
"The Soviet Union made massive efforts to lay the groundwork for a collective resistance to Nazism in Germany, made repeated attempts to create an anti-fascist bloc in Europe. All of these attempts failed," Putin told journalists at a joint news conference with Merkel, according to a transcript released by the Kremlin.
"And when the Soviet Union realized that it was being left one-on-one with Hitler's Germany, it took steps to avoid a direct confrontation, and the Molotov-Ribbentrop Pact was signed," Putin said.
Merkel offered a diplomatically phrased objection, telling the joint news conference that the "Molotov-Ribbentrop Pact is difficult to understand without considering the additional secret protocol. With that in mind, I think it was wrong, it was done illegally," she said, according to the Kremlin's Russian-language transcript.
[...]
Putin's recent remarks mark a sharp about-face from his comments a few years earlier.
During a visit to Poland in 2009, Putin, then prime minister, denounced the Molotov-Ribbentrop Pact as a "collusion to solve one's problems at others' expense."
"All attempts between 1934 and 1939 to pacify the Nazis by making various kinds of agreements and pacts with them, were unacceptable from the moral point of view, and from the political point of view were pointless, harmful and dangerous," Putin said in 2009 during a visit to Poland's Gdansk, according to a transcript posted on the Russian Cabinet website.
But amid Western sanctions against Moscow for its annexation of Crimea and support for pro-Russian separatists in eastern Ukraine, the Kremlin has shifted to an increasing glorification of Soviet dictator Josef Stalin and his regime's pact with Nazi Germany.
The New York Times observed the change as of 2014, in the transcripts of a more obscure meeting of Putin with some historians.
President Vladimir V. Putin has revised his opinion of an important piece of Soviet history, calling the 1939 Molotov-Ribbentrop pact that Moscow signed with Nazi Germany to divide up Eastern Europe not so bad. “The Soviet Union signed a nonaggression treaty with Germany,” Mr. Putin said during a meeting with historians on Wednesday, according to a Russian transcript of the meeting that the Kremlin released Thursday. “People say: ‘Ach, that’s bad.’ But what’s bad about that if the Soviet Union didn’t want to fight? What’s bad about it?” While the Soviet Union is accused of dividing Poland, he said, Poland actually seized part of Czechoslovakia when Germany attacked that country. “Serious research should show that those were the methods of foreign policy then,” Mr. Putin said. Five years ago he had called the very same pact “immoral.” The statement is likely to increase security concerns in Eastern European states, which have been jittery about Russia’s intentions ever since it seized Crimea in March. Mr. Putin signed a law in May mandating five years imprisonment for anyone convicted of trying to rehabilitate Nazism.
Even the 2005 discourse of Putin (an interview on German television that I could only find paraphrased in a book) was not really apologizing for anything, but back then he did mention Western colonialism as a context/equivalent for the Soviet (annexationist) policies:
Putin has even expressed regret for the Baltic states’ historical usage as a
‘token’ in world politics, describing the Molotov–Ribbentrop Pact as a
‘tragedy’ (Putin 2005e). Yet any questioning of Central and Eastern
Europe’s ‘liberation’ by the Soviet Union has met with his immediate
rebuttal.
In the Russian context, Putin’s stance over the Molotov–Ribbentrop
Pact could still be regarded as relatively progressive: despite his insistence
that the Nazis’ taking of power in Germany was the starting point
for the events that led to the Second World War, he points to the
Munich accord and the Molotov–Ribbentrop Pact as the agreements that
both ‘alienated objective allies in the fight against Nazism’ (Putin 2005d).
Yet he simultaneously affirms that since the legislative body of the Soviet
Union – the Supreme Soviet – ‘produced a clear legal and moral assessment
of the Molotov–Ribbentrop Pact’ in 1989, there is nothing left for
Russia to ‘repent’ over any more (Putin 2005e). [...]
In order to disperse Russian responsibility for the fate of the
Baltics after the Second World War, he further argues that the West
could not lay any blame on the USSR for annexing the Baltic states in
particular, since ‘these were the realities of those times, just as colonial
policies were the realities of quite a large number of European countries’
(Putin 2005e). Hence, just as the allies ‘divided up the spheres of influence’,
the Soviet Union simply ‘established its policies with its close
neighbours and its allies … in its own image’ (Putin 2005e).
So, yeah, there was a change in emphasis (over a decade) from equating some historical wrongs to a simpler message of just saying the Soviets were just defending themselves.
The change in emphasis in Russian discourse is accompanied by blaming the West (in part at least) for Hitler's attack on the Soviet Union:
The message from figures in Moscow was that Russia had offered an alliance to France and Britain to counter Adolf Hitler, but that the talks were going nowhere.
The "irresponsible and cowardly policies" of Britain and France had pushed Hitler's Germany to attack the Soviet Union, said foreign intelligence head Sergei Naryshkin.
"Not wanting to wage war on two fronts, Germany made unprecedented concessions to guarantee Soviet neutrality in the Polish campaign," he added.
Foreign Minister Sergei Lavrov, speaking at the opening of the exhibition, accused a number of countries of making short-sighted decisions aimed at appeasing Hitler.
"Naively calculating that the war would pass them by, the Western powers played a double game. They tried to steer Hitler's aggression eastwards. In those conditions, the USSR had to safeguard its own national security by itself," he said.
And for a bit more (historical) context on this issue of the Anglo-French failed negotiations with the Soviets, the Western academic narrative on that is somewhat different:
The Baltic question figured as a stumbling block in the abortive British-French negotiations with the U.S.S.R. in the summer of 1939. The Western unwillingness to sanction the Baltic states’ absorption by the U.S.S.R. was not shared by Germany.
There is a bit more to this issue than Britannica presents; a more in depth article on the Anglo-French-Soviet negotiations paints Chamberlain as extremely distrusting of the Soviets all along, e.g. he wrote in his private correspondence during the negotiations that
I cannot rid myself of the suspicion that they [the Soviets] are
chiefly concerned to see the ‘capitalist’ powers tear each other to pieces while they stay out themselves.
And Chamberlain's mistrust of the Soviets became even deeper when informed that the Soviets were also negotiating with the Germans. Owing to lack of replies from London to their proposals, the Soviets also quickly became convinced that they were the ones being deceived.
papers [from the Soviet archives] show that Soviet officials communicated
amongst themselves as though they were serious about an anti-Nazi alliance in
spite of cynicism over Anglo-French policy. They became angry, and in Litvinov’s case worried,
when there was no response from London. They saw that something was wrong
when they got conflicting messages from Paris and London about Soviet proposals, and
they guessed that it was the same old Anglo-French bad faith. They tried to pin down the
British. Chamberlain saw Soviet policy as a ruse to get Britain and France into a war with
Germany while the USSR sat aside waiting until the end to spread communist revolution
in Europe. The Soviet side saw it the other way around convinced by various Anglo-French
attempts to come to terms with Hitler. No wonder everything went wrong. [...]
At the end of July, everything changed. Molotov opened the door to offers from Berlin.
The shift in Soviet policy occurred over a period of little more than three weeks, hastened
apparently by the Anglo-French delegations’ absence of plenipotentiary authority and by
intelligence that a German attack on Poland was imminent.
As that article goes on to detail, during the Cold War both sides blamed each other for the failed 1939 negotiations, and we see a continuation of that dispute today, with respect to the interpretation given to the alternative 1939 negotiations that did succeed, namely those between the Soviets and the Nazis.