Any money spent by a candidate or a campaign to effect the outcome of the election has to be reported. You or I can spend money to inuence the outcome of an election as long as we don't coordinate with the campaign about it, but the candidate cannot.
The telling thing here is the fact that if this has been done officially through the campaign, it would probably have been legal. Candidates are allowed to donate as much of their own money to their campaigns as they want. All he would have had to do is make a donation to his campaign in his own name, and the law wouldn't have cared. But then, campaigns have reporting obligations.
It is the secrecy that is the problem. Americans have a right to know some basic details about that candidates bidding to represent them.