Postdoctoral fellowship -- what is it about? Assume you are just about to finish your PhD and you are facing the decision of whether to go for a postdoc position or for an assistant professorship. Which one should you choose?

Let's ignore the salary for the sake of this question. Then which of the two is better? What about the benefit of short-time employment and getting to work with lots of different people (in case of postdoc) vs. being stuck at one place for several years (assistant professor). Is it beneficial to work with different groups or is it irrelevant? 

Does a career involving several postdoc positions look like the individual could not get other (''better'') employment (even if they deliberately chose one over the other)? 

Will a postdoc position give you more time for research because you don't have to teach or have to teach less? 

Is it generally better to seek professorship rather than postdoctoral fellowship?
The typical perspective for U.S. people in this situation is to try to balance the following three items:


The desire for a permanent, tenure-track job, and its associated stability.
The desire to do as much research as possible in one's life.
The desire to not starve to death.


Generally those just completing their PhD's are not eligible for tenure-track jobs that have a large research component, because their track record is insufficient.  Therefore it is common to take a postdoc (or two, or five) to bolster the research record.  This has the immediate effect of meeting the second and third goals, and has the potential to open up more research-oriented tenure-track jobs.  However too many postdocs and it becomes more difficult to get tenure-track jobs (and further postdocs).  The implication is indeed as you suggest, that these positions have been taken because the individual could not get a suitable tenure-track job.

Very few people consider "assistant professor" negatively because of being "stuck at one place for several years"; the only reason to turn down such a position is because it may be a bad fit, as compared to the sort of place one wants to be.