There are two problems with your code. First of all logoutOtherDevices() takes user's password as first argument and does that for a good reason. This function invalidates other sessions simply by creating new password hash and it needs current password to do so. If you provide any other string, user's password will be changed to that string. Right now you are passing $user->passwordbut this is not current user's password. It's current hash so you are pretty much changing every user's password.
And current users (Administrator) gets logged out because in order to logout from other devices, you set another user in auth() guard. After the loop you need to manually login admin again. It's easy because you have his ID, so all you have to do is put this code after foreach loop: Auth::loginUsingId($loggedInUser);.
In general I don't think it's the right way to do this, at least if you don't want to reset their passwords. The best way is (at least in my opinion) to delete remember_token for all selected users and also clear their sessions. In order to do that, you need to move sessions to the database. Then you can delete all session for every selected user.
I want to know whether logoutOtherDevices() function erases the users' passwords as well?
It does not erase the password, but replaces it with new one that you've provided to logoutOtherDevices method.
Why the current user (Administrator) gets logout?
Probably cause you missed something. You can always log that user in with Auth::loginUsingID($loggedInUser) until you figure out what you did wrong.
This might help you get better understanding of what is going on. See how password is always different from newPass and once you refresh password gets the value of newPass while newPass gets a new value.