According to the BBC:
The 62-year old [general] spearheaded Iranian military operations in the Middle East as head of Iran's elite Quds Force. [...] Under his leadership, Iran had bolstered Hezbollah in Lebanon and other pro-Iranian militant groups, expanded Iran's military presence in Iraq and Syria and orchestrated Syria's offensive against rebel groups in the country's long civil war. [...]
Gen Soleimani was widely seen as the second most powerful figure in Iran behind the Ayatollah Khamenei. His Quds Force, an elite unit of the Iranian Revolutionary Guards, reported directly to the Ayatollah and he was hailed as a heroic national figure.
As you might expect, Iran (through the voice of Khamenei himself) has pledged to revenge his death...
As for the US (official) statements why he was killed... the full Pentagon statement was fairly brief:
At the direction of the President, the U.S. military has taken decisive defensive action to protect U.S. personnel abroad by killing Qasem Soleimani, the head of the Islamic Revolutionary Guard Corps-Quds Force, a U.S.-designated Foreign Terrorist Organization.
General Soleimani was actively developing plans to attack American diplomats and service members in Iraq and throughout the region. General Soleimani and his Quds Force were responsible for the deaths of hundreds of American and coalition service members and the wounding of thousands more. He had orchestrated attacks on coalition bases in Iraq over the last several months – including the attack on December 27th – culminating in the death and wounding of additional American and Iraqi personnel. General Soleimani also approved the attacks on the U.S. Embassy in Baghdad that took place this week.
This strike was aimed at deterring future Iranian attack plans. The United States will continue to take all necessary action to protect our people and our interests wherever they are around the world.
Some statements before Soleimani's killing have probably predicted an US action like this, in hindsight:
Acting U.S. Secretary of Defense Mark Esper on Thursday announced that "the game has changed" for how President Donald Trump's administration deals with Iran [...]
"There are some indications out there that they may be planning additional attacks," Esper told Politico. "If we get word of attacks, we will take preemptive action as well to protect American forces, protect American lives. The game has changed."
A CRS document notes earlier statements by Trump:
President Trump said in a June 24 interview that he believes he has the authority to direct strikes
against Iran, and said, “I do like keeping them [Congress] abreast, but I don’t have to do it,
legally.”
On June 25, he tweeted that “any attack by Iran on anything American will be met with
great and overwhelming force. In some areas, overwhelming will mean obliteration.”
As Republicans have fairly uniformly supported Trump in this action, we can quote one (or two) of them as summarizing the issue (in what I'd call Trumpian style):
Sen. Ben Sasse, Republican of Nebraska, said in a news release that "General Soleimani is dead because he was an evil bastard who murdered Americans" and "the President made the brave and right call, and Americans should be proud of our service members who got the job done."
His comments were echoed by Sen. Tom Cotton, Republican of Arkansas, who said in a statement that Soleimani "masterminded Iran's reign of terror for decades, including the deaths of hundreds of Americans." "Tonight, he got what he richly deserved, and all those American soldiers who died by his hand also got what they deserved: justice," Cotton said. "America is safer now after Soleimani's demise."
(It seems that, in contrast, Democrats have generally disapproved of the strike, calling it "reckless" and so forth.)
Trump himself has now commented on the purpose of the US action. The statement is a bit long, so here are some excerpts:
Last night, at my direction, the United States military successfully executed a flawless precision strike that killed the number-one terrorist anywhere in the world, Qasem Soleimani.
Soleimani was plotting imminent and sinister attacks on American diplomats and military personnel, but we caught him in the act and terminated him. [...]
For years, the Islamic Revolutionary Guard Corps and its ruthless Quds Force — under Soleimani’s leadership — has targeted, injured, and murdered hundreds of American civilians and servicemen.
The recent attacks on U.S. targets in Iraq, including rocket strikes that killed an American and injured four American servicemen very badly, as well as a violent assault on our embassy in Baghdad, were carried out at the direction of Soleimani. [...]
Soleimani has been perpetrating acts of terror to destabilize the Middle East for the last 20 years. What the United States did yesterday should have been done long ago. A lot of lives would have been saved. [...]
We took action last night to stop a war. We did not take action to start a war.