Why did Lockheed Martin give the F-22 stealth fighter such small fuel tanks?
The F-22 was developed in the 90's, primarily for use by the United States Air Force. This means it was designed to serve specific mission profiles. The F-35 however is going to replace the F-22 and serve all the air branches of the US Military. This means that it needed a broader mission profile. The last F-22 delivery was in 2016.

For the F-22 Raptor:


  
  Range: >1,600 nmi (1,841 mi, 2,963 km) with 2 external fuel tanks
  Ferry range: 1,740 nmi (2,000 mi, 3,220 km)
  Combat radius:
  &nbsp;&nbsp;&nbsp;460 nmi (529 mi, 851 km) clean with 100 nmi (115 mi, 185 km) in supercruise
  &nbsp;&nbsp;&nbsp;590 nmi (679 mi, 1,093 km) clean subsonic
  Service ceiling: 65,000 ft (20,000 m)
  


And for the F-35 Lightning II:


  
  Range: 1,500 nmi (1,700 mi, 2,800 km) +
  Combat range: 
  &nbsp;&nbsp;&nbsp;669 nmi (770 mi, 1,239 km) - Combat radius
  &nbsp;&nbsp;&nbsp;760 nmi (870 mi; 1,410 km) - Combat radius (interdiction mission on internal fuel, for internal air to air configuration)
  Service ceiling: 50,000 ft (15,000 m) +
  


You can see that the F-22 range (not the combat radius) is very similar to the F-35. The problem with the F-35 is that because it is available in VTOL configuration, it burns a lot more fuel. The VTOL F-35 (F-35B) only has a mission radius of 505nmi. This is because during VTOL operations the F-35 burns an incredible amount of fuel. So much so that a VTOL take-off usually requires mid-air refueling shortly after take-off.

Either way this boils down to a trade-off between how much gas to carry and how much weapons and other systems to stuff into the aircraft. The VTOL versions need much more complicated internal systems that take up a lot of space, so the range and payload suffer. Tanks can be mounted on external hard-points, but then radar cross-section becomes much bigger and maneuverability is decreased. 

With mid-air refueling all the aircraft must really do is be able to go from a friendly area where the tanker is, complete the mission, and get back to the tanker, so range isn't as important as versatility.