Custom Registration Form and Passwords

The password is hashed in the DB then you need to set it with wp_update_user

wp_update_user([
    "ID" => $user_id,
    "user_pass" => $_POST['password'],
]);