Play every class if you don't already. It helps a lot; when you're blocking out a map, you will get in the habit of thinking, "If I were a scout, what would I do here? If I were a spy, what would I do here?" etc, etc.
If you ask yourself that for every class, and for one class you have no idea how it could be productive in this area, you need to change something about the layout.
On the flip side, if there is an obvious spot a class will go and it doesn't have any counters, you need to consider if that area is overpowered.
For example, if you think "I'm a heavy, I'm totally going to stand on this high ground and there's no way for a spy to get behind me, or a sniper to hit me without being close up" then you have a problem area. Or for example, if you go "I'm a sniper, I stand here where it's dark, out of spam range, and anyone who attacks me has to come straight through this open area" then you have a problem area. Etc.
Basically the more time you spend thinking long and hard about what class is expected to do in each area you make, the better your layout will become. And then you'll have sort of a mental checklist to go over -- maybe it turns out like this:
- Make sure spies have places to decloak within reach of at least a small ammo pack ("spy closets")
- Make sure scouts have areas that are roomy and interesting jump locations
- Give snipers a location to shoot from that can always be either flanked or spammed
- Give medics cover to hide behind while they heal their patients near chokes
- Give soldiers interesting places to jump up, make sure your skyboxes are high enough
Etc, etc.
And you'll find that a lot of spaces on a map will serve dual purpose. That spy closet might also be a really good sentry spot. This flank might be really great not only for scouts, but also pyros. This is good; you want people who play different classes to always be interacting with other classes.
Also time how long it takes for each class to go between all the important areas of the map. Spawn to capture point A. Fallback from cap A to cap B. So forth. This is very important. You don't want classes arriving too late to make a difference, and you don't want areas so closely packed together that everyone gets there at roughly the same time.
Doing this will not magically make your layouts perfect the first time, but it WILL help a lot.