You have a file containing two space separated fields, the username and the password:
pippo mm
pluto tt
You can use a script like this to process the file, creating the user account and the corresponding directory:
ftpuid=$(getent passwd ftp | cut -d: -f3)
if test -z "$ftpuid"; then echo "No ftp account" >&2; exit 1; fi
while read -r user password
do
test -z "$user" && continue
echo "Creating account for $user, with home /srv/ftp/$user" >&2
useradd -d /srv/ftp/"$user" -M -N -g ftp -o -u "$ftpuid" "$user"
mkdir -m700 -p /srv/ftp/"$user"
chown "$ftpuid":ftp /srv/ftp/"$user"
test -n "$password" && ( echo "$password"; echo "$password" ) | passwd -q "$user" 2>/dev/null
done < file.txt
There are other options for settings passwords such as chpasswd, but I don't believe that this appropriate here.
testhave blanks lines?