That's how bank accounts in NY State currently work. However, if your account has been idle for a while, your bank tries to contact you to tell you about it. If you have on-line banking, logging in to your account usually makes it active again.
Also, in the event that your money does get turned over to the state, you can ask the state to return it to you.
I think this law is primarily designed to ensure that if people die without leaving a will, the funds will go to the state rather than to the bank. If heirs (e.g., next of kin) turn up eventually, it's easier to go to the state's web site and look for unclaimed property under someone's name than to try to figure out which of hundreds of banks the deceased had his account at.