Also second-hand and rusty ones are better than new ones. Some Dutch cities have a free-of-charge engraving mechanism where you basically engrave a serial number on a bike to make it easier to track down stolen bikes, as well as to know that you're not actually buying a stolen bike.
Also, you'll be responsible if you're caught with a stolen bike, which is a nice deterrent to actually use a reliable source when purchasing a bike. Shops act as a middlemen between you and the person selling the bike, and they're responsible for making sure that the bike you're purchasing from them isn't stolen. On the downside, that drives the cost up a bit, but on the bright side, you usually get some months of warranty period in which they'll repair your bike free of charge in case anything happens to it.