The Labour leader explained trust was important for both the Scottish Parliament and the role of First Minister, regardless of who holds the role.
Speaking exclusively to The Scotsman, Sir Keir’s warning came as Ms Sturgeon prepares for the results of the James Hamilton QC inquiry into her own conduct and with the First Minister facing a vote of no confidence on Wednesday.
Sir Keir said: "The integrity of the Scottish Parliament and the integrity of the First Minister is far more important than the person who is currently First Minister, whoever that is.
“It matters always, but it particularly matters during a pandemic where we’re asking so much of other people.
"We have to wait to see what the report says and should not prejudge that report, but if the finding is that the First Minister misled Parliament and potentially broke the ministerial code, then the integrity of office resignation kicks in under the code.
“In the same way I strongly felt that Boris Johnson as Prime Minister should have asked [home secretary] Priti Patel to stand down when she was found by his adviser to have breached the ministerial code.
“It’s about that trust in Scottish Parliament – confidence and trust really matter."
Pointing towards Mr Johnson’s decision not to comment on Ms Sturgeon, Sir Keir added: "Once you depart from integrity and trust, you lose an anchor and then you’re not in a position to call for other people to display the integrity and trust you’re calling for yourself.”
On Scottish independence, Sir Keir also admitted he understood why some Scots were unhappy with Westminster, but vowed to build a United Kingdom they could be proud of.
He said: “I completely understand many people in Scotland looking at the Westminster government and seeing a decade of Tory government and feeling that they do not share the values of the Westminster government.
“I have said time and again to my own party that we need to get back to winning ways. We need to get back to winning general elections in the United Kingdom, so that the values that we share across the United Kingdom are the values that I believe and the values across large parts of Scotland.
“The answer to that is not to break the United Kingdom out and to put up borders.
"I completely accept that simply accepting the status quo is not sufficient and we need to listen much more carefully to people in Scotland who say we need change.”
The Labour leader explained he was trying to address this already, including through the commission with former prime minister Gordon Brown on how people could have more power and influence over decisions.
He said: “We face a pandemic together across all four nations, sharing and working together and we have to recover together.
“I don't think generations to come are going to forgive us if just when we need to pull together to come out of the recovery as four nations, we get side-tracked into a question of whether we should break up the United Kingdom.
“If you look at the economic forecast for Scotland, the next few years economically are crucial in terms of recovery.
“We should all be sweating blood across the United Kingdom to make sure that recovery is successful and that Scotland can thrive."
The Holborn and St Pancras MP also stressed his passion for Scotland and claimed only Labour MSPs were focused on the Covid recovery.
He said: “Scotland really matters to me as Keir Starmer, but also as leader of the Labour party.
"This election is going to define where Scotland goes next.
“The choice is actually now becoming increasingly clear in the election because you've got on the one hand the Scottish Tories, who coming out of this pandemic want to take us back where we started, and you’ve got the SNP who are increasingly obsessed with taking us back to division with their focus on a referendum and almost nothing else.
“And then you’ve got Anas Sarwar of Scottish Labour saying it has to be all about recovery.
“That’s why Scottish Labour is not producing a manifesto, but producing a recovery plan for Scotland which focuses and drills down into the economy, into education, into the NHS in Scotland and its public services.
"There’s also a wider piece for me here because in a sense where you stand on Scotland defines your politics. It’s not just the institutions, it’s a shared history and shared values and shared families.
“These are stark choices. Do you believe in cutting each other off and giving up, or saying there is more in what unites us than what divides us?”
The former head of the CPS also revealed what he was most looking forward to doing when life was back to normal, as well as who his Scottish football team was.
He said: "I want to go to a football match, go meet friends, have a drink and enjoy a game.
"My club is Arsenal, so that will probably be my first port of call, but I play football every week and one of the guys I play football with called Jamie comes from Dundee and is a long-standing Dundee United fan and so every week I get to learn what Dundee have been up to.
“Because of him, I always look out for the Tangerines.”