No, you don't need to play Call of Duty 2 before Call of Duty 3, and it doesn't really matter for the story.
Both are fairly old titles now, so if you're looking for a great modern experience, you might jump to a newer entry like Modern Warfare 3 and enjoy its online play. And if you were actually asking about the Modern Warfare games, note that MW2 and MW3 play almost identically—so the order won't affect your enjoyment there either.