The commission investigated the complaint about Catz Club - which uses the working name of Schoolfriendetc - when it was made by Greg Clark, the shadow charities minister, at the end of last month.
Andrew Hind, chief executive of the commission, said: "Donations to political parties are absolutely prohibited for charities, so this was of serious concern to us."
The charity, which provides after school clubs, told the commission the donation had been caused by an "administrative error". It said it should have been made by its trading subsidiary, Catz Club Services Limited.
But the commission told it that, although trading subsidiaries were allowed to carry out non-charitable trading activities, they were not permitted to carry out political activities forbidden to charities.
Clark said: "If a charity has to spend £7,500 to lobby ministers, that's an appalling state of affairs." He also criticised the charity for saying the payment was an administrative error.
Hind said: "This is a good result for the charity, and means we don't have to look at the question of liability. In a similar situation, if an inappropriate donation was not returned, we would require the trustees to personally repay the misapplied funds to ensure that the charity did not lose out."
The Labour Party has also agreed to the charity's request for the return of another £7,500 it paid to attend an event at which it lobbied senior politicians for increased funding of after-school childcare facilities.
A party spokesman said: "The Electoral Commission has confirmed that the Labour Party did nothing wrong in accepting this donation, which is allowed under party funding rules.
"We accepted this donation in good faith, but once Catz Club were told that they had inadvertently breached Charity Commission rules, we were asked to return the donation, something we were happy to do."
The commission is also investigating Schoolfriendetc's failure to submit accounts for the financial year ending September 2007. In the previous year its income was just over £850,000 and its expenditure was more than £4.25m.
In the light of the public interest and the wider lessons to be learned from the case, the commission has published a regulatory case report about it.