That's because:
number * '\0'
= number * 0 ('\0' converted to int)
=> always equal to 0
To generate a string filled with \0
(or any char) of a certain length, use:
new string(`\0`, number)
In your case:
string newStr = listView1.Items[i].SubItems[2].Text;
bw.Write(enc.GetBytes(newStr + new string('\0', (31 - enc.GetByteCount(newStr)))));