They did not avoid digital at all, in fact they were an early entrant to digital. The problem was that they were used to having a lucrative near-monopoly in film, a fat side business in film processing and a nice low-end camera business built around proprietary "connvenience" film packaging. They were now facing aggressive consumer electronics companies who were used to relently feature upgrades and short model lifecycles. Moreover, they could not rely on their film dominance to keep competitors at a disadvantage. In other words, they had to change their business model completely-- from near monopoly to completely competitive-- in order to success in the new business. Only a fraction of companies manage to do this successfully.
Keep in mind, also, due to the increased competition and lack of a film component, that the opportunity for Kodak in digital was much smaller than their film and related businesses. It's very hard to manage a shrinking company, and even harder if you are also trying to reinvent yourself.