The F-22 is an air superiority fighter, the F-35 is an attack fighter.
First, if all they needed was a strike aircraft with overwhelming air-to-ground capability, they already had it with the A-10 Warthog (or Thunderbolt II for you purists). It can carry a cubic assload of bombs, has extended loiter capability, can take off and land on short, unimproved runways, is perhaps the best aerial gun platform in the history of aviation, and can take an immense amount of punishment, make it back to base, and be repaired for another strike before the pilot has time to grab a sandwich. Alas, it's not "sexy" enough so nobody wants to fly it. Fighter jocks look down on the "air-to-mud" boys, you know. But us grunts -- I'm a former Marine -- absolutely love knowing your call for CAS is being answered by a 'hog.
Second, the F-35 is not just being pitched as an "attack fighter" as you claim. It's being positioned as the Swiss Army Knife of airframes, the complete multi-role, multi-service, multi-theater, all-season do-it-all flying wonder plane. It's stealthy...but not terribly stealthy compared to other airborne threats. It's fast...but not very fast compared to fighters it's likely to face. It can flow slowly for accurate bombing...but not as slowly or as accurately as what we already have. It has endurance...well, not so much. And it costs less than what it's replacing...except it doesn't. McNamara tried this same crap back in the 60's and we ended up with the F-111, a "fighter" that couldn't fight. It was too big, too heavy, too complex, too expensive to make, too expensive to maintain, too hard to fly...and *nobody* wanted it. Today the F-111's are largely rusting away somewhere while B-52's are still flying, delivering bombloads much more effectively, reliably, and cheaply.
Honestly, what the US needs in the way of air power is this:
- A small but elite force of the stealthiest, fastest, most-maneuverable, most survivable, most advanced aircraft this country can possibly produce (i.e. F-22, B-2). These are our "alpha strike" planes. They go in on the first day of a conflict and kick the shit out of SAM sites, ground- and air-based RADAR, Command and Control facilities, fuel and ammo dumps, runways, and staging areas. After a brief but furiously intense campaign, the enemy is left without any effective way to defend against even basic air strikes. Then the war is turned over to...
- A medium-sized force of semi-stealthy and non-stealthy attack aircraft (fixed- and rotary-winged) which can now operate with near impunity due to degraded enemy defenses. A-10's, B-52's, F/A-18's, AH-64's...you get the idea. These are much more affordable than the "alpha strike" package to keep operational. They're also already bought and paid for, have large cadres of trained pilots, and can deliver much bigger attack loads than their stealthier brethren. This phase keeps up until the enemy is more or less fully subdued and organized resistance has almost been wiped out. Then things are turned over to...
- A very large force of unmanned and/or autonomous drones equipped for air-to-air and air-to-ground operations. These can be cheaply maintained for an indefinite period with absolutely zero political cost should one get lost to enemy action. Further, they act like omnipresent snipers, orbiting beyond normal aural and visual range but ready to deliver a laser-guided Hellfire "bolt from the blue" in an instant. The effects of such constant threats on enemy morale cannot be understated. Meanwhile, our "boots on the ground" are largely back home or operating in secure areas, reducing the chance of domestic upheaval by an unhappy populace over some "neverending war."
The biggest mistake this country is currently making is assuming we need just one type of aircraft for just one type of conflict. Modern wars have many different phases, most of which will involve a "low intensity conflict" in an area where large, high-value targets are not present. Having a fleet of super-advanced weapons which costs too much to make and too much to maintain is just stupid when there are better options on the table.