In the worldspawn, put:
"gamemode" "4" -- that tells the game it's a CTF map.
"maxteams" "2" -- if you just want 2 teams.
"team1" "red" -- anything with "teamnumber" "1" will be red
"team2" "blue" -- anything with "teamnumber" "2" will be blue
Now, create a "flag" entity, and put:
"gamemode" "4" -- that tells it to show up in CTF mode
"teamnumber" "1" -- that makes it a red flag.
Then make another one with "teamnumber" "2" for a blue flag. Do the same thing with the "base" entities (you have to apply those to brushes).