R, 223 bytes
function(x){a=apply(do.call(rbind,lapply(p<-strsplit(strsplit(x,"\n")[[1]],""),function(x)c(x,rep(" ",max(lengths(p))-length(x))))),2,function(x)c(x[x==" "],x[x!=" "]));for(i in 1:nrow(a))cat(a[i,][a[i,]!=" "],"\n",sep="")} This is an absurdly long, naïve way of doing it.
Ungolfed:
f <- function(x) { # Start by spliting the input into a vector on newlines s <- strsplit(x, "\n")[[1]] # Create a list consisting of each element of the vector # split into a vector of single characters p <- strsplit(s, "") # Pad each vector in p to the same length with spaces p <- lapply(p, function(x) c(x, rep(" ", max(lengths(p)) - length(x)))) # Now that the list has nice dimensions, turn it into a matrix d <- do.call(rbind, p) # Move the spaces to the top in each column of d a <- apply(d, 2, function(x) c(x[x == " "], x[x != " "])) # Print each row, omitting trailing whitespace for (i in 1:nrow(a)) { cat(a[i, ][a[i, ] != " "], "\n", sep = "") } } You can try it online.