The iPhone includes a dedicated YouTube application with access to some of the site's video content. Unfortunately, much of the vast library still has not been converted by YouTube to play properly on the iPhone. That's where TubeTV comes in. Available as freeware, TubeTV can convert any YouTube video from its default Flash format to an .m4v file that can be synced to and played on the iPhone.
This nifty little app has a built in Web browser (and a built-in YouTube search mechanism) that allows you to navigate to the YouTube (or Google Video) movie page of your choice, then click the Save button to automatically export it in an iPhone-compatible format (go to Preferences and select Auto convert downloads for: iPhone). You can also grab a URL from your currently running Web browser to save.
Once you've saved the video -- by default, it goes to the Desktop -- just double-click it, and the video will move to the iTunes library, then to your iPhone on the next sync. Make sure your iPhone is set to synchronize videos by clicking on its icon in iTunes, then selecting the Video tab).
The video conversions are done using QuickTime's H.264 codec, but you'll also need to install the free Perian conversion codec (you'll be prompted to do so when you first launch TubeTV).