Revenue & Customs needs better in-house skills to cope when its current £7.9bn IT contract expires in 2017, the spending watchdog has said.
The National Audit Office said the tax authorities needed more expertise to challenge suppliers over their performance and value for money.
It said the Aspire contract had brought benefits but contractors had made much larger profits than envisaged.
Revenue & Customs said it had become "less dependent" on outside knowledge.
Aspire is the government's largest IT project, with expenditure of £7.9bn between July 2004 and March 2014.
Under a contract agreed by the last Labour government, French IT firm Capgemini and its subcontractors maintain and operate Revenue & Customs (HMRC) tax systems as well as providing other ICT services such as computers, telephony, printing and networking.
In its first review of the contract for eight years, the NAO said it had helped improve the agency's operational capability, enabling more tax and VAT returns to be submitted online and reducing fraud and error.
While the contract had helped bring in higher tax yields and deliver significant cost savings, it said, the tax authorities had been "overly dependent" on the technical capability of its suppliers, limiting their ability to manage the contract and secure commercial benefits.
It suggested there was evidence that HMRC's relationship with Capgemini and other firms had become "too accommodating" and had "ceased to offer performance challenge or to create price tension".
It said Capgemini and its major subcontractors, including Fujitsu, had made £1.2bn in total profits from the contract so far, double the level that had been modelled in 2004.
The suppliers' profit margins, while not out of line with the industry average, were higher than anticipated as the contract had been extended and more work awarded, it said.
While acknowledging that steps had been taken to build up HMRC's internal IT resources, such as the hiring of a new digital director, it said there were still "significant gaps" in its expertise.
Since coming to power in 2010, the coalition government has insisted that Whitehall departments work with a wide range of contractors to drive competition and innovation and that contracts were not automatically extended.
The NAO said the Aspire contract was "no longer consistent" with this model, but while HMRC and Capgemini had agreed to make changes to the contract in 2012, it warned that there had been "limited success" so far.
It said HMRC faced a "considerable challenge" in reforming the contract while also developing a successor programme from 2017 that would "modernise and digitise" tax-collection systems while also ensuring value for money and guaranteeing levels of service to the public.
"HMRC faced complex, long-term technology challenges, and Aspire provided an appropriate means of working through them and limiting risk," said Amyas Morse, the head of the NAO.
"However, there has been a lack of rigour in HMRC's commercial management of the contract. It is essential in any contract that the client retains the independent expertise to challenge the supplier."
Labour MP Margaret Hodge, who chairs the cross-party Commons Public Accounts Committee, said the handling of the IT contract had been "unacceptably poor".
"It is deeply depressing that once again a government contract has proved better value for the private companies involved than for the taxpayer," she said.
HMRC said Aspire was one of the largest outsourced contracts in the world and had helped to generate tax yields of more than £500bn to the Exchequer last year while providing a range of other services.
"The NAO recognises the progress that HMRC has made over the last two years in developing in-house technical skills, so that we are less dependent on external suppliers," a spokesman said.
"For instance, we recently opened a new digital delivery centre in Newcastle as part of our digital transformation programme.
"We will continue to improve the performance of the contract over the next three years."