People with drug or alcohol addiction problems are being sent to prison for non-violent crimes rather than rehabilitation centers where their problems would be tackled.