Massachusetts must pay the federal government $2.1 billion over the next decade after the Baker administration mistakenly used federal pandemic funds to cover unemployment benefits, officials said.