I want to farm sheep for their wool. What's the best way to make them spawn or gather them up into one pen?
Edit: The answer below is now outdated since a much easier solution exists – by holding wheat for cows, mooshrooms and sheep, carrots for pigs, and seeds for chicken, animals will follow you. After rounding up two of each animal, you essentially have an infinite amount of them, since you can breed them. Sheep also regrow their wool by eating grass, so you don't even need to breed them to have a constant supply of wool.
Here is a modular design to make a series of spawning pads that will spawn animals, and collect them in a central area. The pads end up being 8x6, except for the ones right next to the collection pit which are 4x6.
The glass area here would be fenced off.
They all drain to this central pit.
Water is placed at the beginning of each trench, and the signs prevent water from moving backwards. This is a secondary intersection that continues off each main channel. (The water should be flowing right to the sign, I might have made the channel too long in my haste.)
And now that Single Player Commands is working with the current version of Minecraft: an aerial view!
In order to make an area that spawns strictly non-aggressive mobs, there is already an answer that covers how to do it. To summarize, you basically need grass blocks that are well-lit (a light level above 9) in order for non-aggressive mobs to spawn.
Using a system of flowing water between these grass areas you can gather all mobs that fall into the water into a central area. There are many videos that demonstrate how to do this (example).
The following height map shows one such arrangement (1 being the lowest height, 5 being 4 blocks above any 1 block) which will result in water flowing from the top-left corner to the bottom-right corner such that no mobs can jump out of the flowing water:
33333332 35555552 35555552 35555552 35555552 35555552 35555552 22222221
Place your water on the upper-left 3 level tile and your grass tiles on the 5 level in the center with a torch in the middle. Note that you can tightly pack these units to make a giant mob spawner, although mobs must be within a 9x9 grid of chunks centered on you (or another player) in order to spawn.
Then stand where all your animals drop, pull out a diamond sword and simply chop. You can also kill them by dropping them from the sky with a sky-spawner. Lava-based traps might not work as they will likely destroy the wool.
Since Minecraft 1.7, you can use a Lead.
For PE, just dig a hole that is two blocks deep and one block wide and wait for the sheep (and pigs) to come in and build the tunnel thing to where you want to have sheep. Usually I just keep them in a spare house until I have a pen.
On the other versions, just hold wheat and they follow you. The best pen on the other versions is a one block deep hole with fencing on the walls of the hole. Make a one block wide entrance to the gate and since nothing can jump over a fence they can't get out.