First, for Commodore's part, it should be obvious the reason for choosing the 6502 microprocessor for all their 8-bit machines (notwithstanding the dual-processor SuperPet and C128) - Commodore owned MOS. Jack Tramiel was very focused on vertically integrating his manufacturing, which basically assured Commodore's use of MOS CPUs and support chips. Since Commodore sold more 8-bit home computers than any other vendor, this fact alone greatly influenced the 6502's preeminence.
Second, the aggressively low price point of the 6502. Chuck Peddle's team developed the 6502 to be a low-cost, compatible, Motorola 6800 "killer", much the same way as Zilog did in targeting the Intel 8080 with the Z80. Again, Jack Tramiel's willingness to far undercut his competition kept the 6502 as a relative bargain among the early 8-bit options. As noted in this question the 6502 was around 1/3 the cost of the Z80, and both were far cheaper than Motorola and Intel equivalents.
Third, MOS also created system support chips that were designed to easily interface with the 6502, such as the 6522 VIA. This made adding I/O capabilities very simple for system designers, and that freed them to focus more on custom circuitry that would help distinguish their system in the marketplace of many computers built around this basic chipset.
Fourth, the early success of the several 8-bit machines in both North America and Europe created a virtuous ecosystem of hardware designers and software programmers that knew how to work with the 6502. The momentum and professional user base made for a popular "platform" even before that term was widely used, and this reinforced vendors to stick with it as long as it remained technologically competitive with newer CPUs, and perhaps even longer. Indeed, the video game console industry shared in this platform ecosystem, and the 6502 dominated that category too. First in Atari consoles and then in the original NES, which used an ASIC version of the 6502 in the form of the Ricoh 2A03.
Fifth, the 6502 had robust industry support that delivered enhanced versions (65C02 CMOS version, 65C816 16-bit version), higher clock speeds (capping out at 14MHz), alternative chip manufacturing sources (Rockwell, Synertek), and licensing of the 6502 IP to create custom ASIC devices. In this sense, it was a precursor to what happened with the ARM platform in the embedded computer (phones, etc.) industry. These enhancements and licensing extended the lifespan of the platform, leading to its inclusion in many additional computer and console products.
If the KIM-1, released in 1976, and the Super NES (65c816 core), released in 1991, can serve as "bookends" for the 6502 platform dominant years, that represents a 15-year run in the home computer and console market. Of course, by 1991, the computing world was rapidly consolidating around the IBM PC "clone" standard, but the low-cost, high-volume, Super NES was capable of graphics, sound, and gaming abilities that exceeded much more expensive PCs. It was even competitive with newer 16-bit CPU systems more purpose-built for gaming, like the Amiga, Atari ST, and of course the 68000-based Sega Genesis. Even today, the 65C02 CPU continues to be manufactured and licensed (as a core CPU) for use in embedded systems.