In the early game I try to only found cities that either bring in more money than they cost in maintenance, or have a good hammer yield. Cities that do neither are worthless and only slow you down.
I disagree. If settling in a less-than-ideal spot brings in
new health and/or happiness increasing resources, then every other city in your empire experiences a lifting of the previous population ceiling, allowing them to be that much more productive or commercially successful as they utilize more tiles within their superior radius. While individually your newly-founded city is a slight drag on your empire, from an empire-wide view, it was a wise choice.
That said, all the less-than-ideal tiles have some use:
-deserts and ice floes, especially ridiculously large ones, restrict enemy settlement as well. You can rely on being safe from the enemy settling too close to you when these terrain types are near. Deserts tend to have lots of gold, incense and oasies, so settling nearby a flood plain running through the desert can be unexpectedly successful.
-tundra isn't a complete loss. You can irrigate any tundra next to a river, and by simply leaving most of it untouched, you can encourage forest growth over the empty tundra spaces. A properly-planned late game tundra city can do well enough, with irrigated spaces providing 3 food and lumber milled forests providing 2 hammer and 1 food. It won't be a powerhouse city, but if it grants access to all the tundra-abundant resources (good seafood, furs, silver, deer) then it's likely worth it.
-mountains, while completely unworkable can funnel an enemy into having to approach you through a certain vector. This is a good opportunity to place a defensive city or fort in a strategic pass.