ATMs are typically available on board cruise ships belonging to major cruise lines like Carnival, Royal Caribbean, Norwegian, Celebrity, Holland America, Princess (& many others). However, most charge considerably higher fees for use in addition to any charges assessed by your bank.
While onboard the cruise ship, cash is not accepted as payment for any items including drinks, additional food options, spa treatments etc. All transactions are charged to your onboard stateroom account which is connected to your credit card or a cash deposit.
Cash is accepted for additional tips for your stateroom attendants and waiters. Having cash while at port is always a good idea because ATM's may be harder to find while at port.