You are correct - in cases where there is a brand-name version of a dug AND also a generic version of the same drug, the generic is usually provided unless the brand-name is specifically requested.
But, the parent post is describing cases where there is a new, brand-name drug that fills the same niche as an existing generic. Two different drugs, but often only slightly differing results. MDs often prescribe the newest, assuming it's better than the generic. MDs receive much of their ongoing education about drugs from the pharmaceutical sales reps, so they are bombarded with ads and samples (just as consumers are with ads on TV).
As an aside, my dermatologist has been good about ensuring the costs of any treatments I receive are managed. She's recommended specific pharmacies, brand-name vs generic, and other tips/tricks to reduce the costs. This despite the fact that I don't directly bear any of the costs because I have a decent medical plan.