GolfScript, 15 bytes
At the beginning of the program, the input is put onto the stack. Each . copies the top of stack. Each n pushes a newline onto the stack. " " pushes a space. \ swaps the top two elements. At the end of the program, the stack is output to the standard output.
Try it Online
naz, 46 bytes
Strictly speaking, the above program outputs the exact byte stream required to make the square, though the top of the square will be misaligned given that the interpreter linked above always prepends output: to program output.
Explanation (with 0x commands removed)
1x1f0m9a1a1o # Function 1
05AB1E, 36 bytes
Slow brute-force approach (already times out for the last test case on TIO), but it works.
First input is the list of brick sizes and second input is the height integer.
Try it online or verify a few test cases at once.
First get all possible ways to divide the list of bricks into ...