WordPress User getting added with id of 0

The ID column if the wp_users table is the Primary Key and auto-incremented. If your table isn’t set that way then something must’ve gone wrong while it was getting created. Try deleting all the tables from the database and re-installing WordPress.