Is it illegal in the UK to spy on the US?
Laws are carefully written. In both nations it is unlawful to knowingly harbor a spy without government authorization, and it is unlawful to knowingly give information to a foreign spy without government authorization. In the UK it is illegal as far at is it "for any purpose prejudicial to the safety or interests of the State". In the US it is illegal " in any manner prejudicial to the safety or interest of the United States or for the benefit of any foreign government to the detriment of the United States".
Basically someone can spy for the government, or they can work with the government to feed information as a double-agent, but they can't be against the government.
If not, what exact reason would there be to extradite him? Even the accusation is rubbish.
The accusation for conspiracy was only mostly rubbish, if he were traveling through the US it could have likely been enforced. But he wasn't in the US.
Further the international law regarding spies is tricky. The big one in the case is under the Fourth Hague Convention that the US belongs to, a spy needs to be caught in the act and receive a trial. If a spy is able to return to their own protections before being apprehended, Article 31 says "A spy who, after rejoining the army to which he belongs, is subsequently captured by the enemy, is treated as a prisoner of war, and incurs no responsibility for his previous acts of espionage."
There is a strong claim that at most, he could have been treated as a prisoner of war for a war that ended years ago.
The original criminal charge was a single count of conspiracy, the conspiracy was to commit two crimes: gathering, transmitting, or losing defense information, and for fraud through unauthorized computer access. It is the criminal conspiracy is the crime, and only a single criminal charge. The direct crime was punishable up to 5 years, and the rules about conspiracy are much like the getaway driver getting charged with the robbery, or the drug dealer's lookout getting charged with dealing, he could face up to another 10 or so years for the crimes that were conspired to commit. Sentencing rules are complex, and most likely if this were the entirety of it, if he were a US citizen an he was convicted of those specific crimes alone he'd likely see around 8-12 years of prison. But it isn't the entirety of it.
There is a great big: HOWEVER, after he was in custody the US officials added that they're seeking extradition on 18 counts, adding 17 additional charges once he was held in UK custody. Those bonus charges include more conspiracy charges, espionage, obtaining national security documents, and disclosure of national defense information, punishable by up to 170 years in prison all together. Most critically several of the charges are likely violating the US First Amendment freedoms of the press, and the Fourth Hague Convention mentioned above that the US is a signatory for. It is unlikely that even if he were a US citizen the vast majority of them would not survive legal challenge apart from maybe 30 or 35 years like Manning's maximum, which ultimately ended at 7 years. Being a foreign national (Australian) doing the acts in another country would make them even more difficult.
The very real concern is that the US government will add additional charges once he is extradited. That's exactly what the UK government is prohibiting with the extradition ruling: either the US provides substantial guarantees that they won't inflate the charges to spying because include the death penalty, and a that he will be given full protections for free speech as though he were a US citizen, which would protect his journalism claim.
The court isn't accepting a simple "We pinkie-promise we will keep it to the original charges", the court has said they want stronger assurances. This has entered in to the case, since US officials have previously been found directly lying under oath about the original sealed indictments, originally declaring that Assange was not named in an indictment, then accidentally revealing in another, unrelated case "through a cut and paste error" that this was a lie, done quite intentionally. The additional 17 charges added after the initial arrest further reinforce that a simple agreement is insufficient, the prosecutors have directly lied under oath once, and remained silent about hidden information in sealed documents multiple times. They have established a clear track record, and it isn't good for them.
Basically the court is requiring strong evidence that the guy's rights will be protected. If they don't get them as strong assurances, they'll ultimately release the Australian national freely back inside the UK as a commonwealth citizen.
If the UK did allow extradition and the US successfully prosecuted for espionage, Australia could bring an international lawsuit as a violation of the Hague Convention that the US agreed to. They could also likely encourage diplomatic and economic pressures throughout the Commonwealth as this has so heavily involved the UK in protecting an Australian citizen.