Well, you're writing uname1, password1 and email1 to a file, separated with three spaces (and for what reason ever, three more spaces at the end of each line).
Use str_repeat
to add as many spaces as you need: http://php.net/manual/de/function.str-repeat.php
Like this:
$stringData1 = $POST['uname1'] . str_repeat(" ", $longest_uname - strlen($POST['uname1']) + 1);
fwrite($fh, $stringData1);
$stringData1 = $POST['password1'] . str_repeat(" ", $longest_password - strlen($POST['password1']) + 1);
fwrite($fh, $stringData1);
$stringData1 = $POST['email1'] . str_repeat(" ", $longest_email - strlen($POST['email1']) + 1);
fwrite($fh, $stringData1);
You'll need to find out $longest_uname, $longest_password, $longest_email first by iterating through your array and finding the longest string for each of your columns.
If you don't need the last column to be right-padded with spaces, you can skip the "longest_email"-part.
EDIT: Of course the "tab"-solutions mentioned here will work, too, but only if the difference between the lengths of your strings in one column will not exceed one tab. Also the "substr(..., 14)"-method will work, but only if no string is longer than 14 characters ...