SPI design and general sequential design problem
What frightens me most is not the code but the remake "Which works somehow."What you have is a serial data protocol. That just screams for a shift register. Instead you are instancing multiplexers all over the place using  an index with an mathematical operator like: 

SPI &lt;= write_command[3-counter]; 
                     ^^^^^^^^^


I have built several SPI interfaces both in FPGA and ASIC. I always start with a statemachine. Obvious states are: IDLE, SHIFT and maybe a STOP.
From IDLE to SHIFT you load the shift register and set the CS low. in SHIFT you shift that data out. I would normally go back to idle but you can add a STOP state to set the CS high again.  What you also might need is a clock divider. An SPI works at e.g. 1MHz but the code often runs at 10-300MHz. 

I could find code I have in my archive, but I refrain from that because the best way to learn is to write it your self. 
Here are some code snippets (all written as I go thus, not checked)

localparam STATE_IDLE  = 2'b00,               
           STATE_SHIFT = 2'b01,
           STATE_STOP  = 2'b10;


case (state)
STATE_IDLE : // Here you need a signal that new data has arrived
    if (new_data)
    begin
       shift_out &lt;= {write_command, Data}; 
       CS_L      &lt;= 1'b0;
       count     &lt;= 5'd0;  
       state     &lt;= STATE_SHIFT;
    end // case IDLE

STATE_SHIFT: // Shift a bit out every second count
    begin
        count &lt;= count + 5'd1;
        SCK   &lt;= ~count[0]; // High after first count
        if (count==5'd31) // or 30? 32? Check in simulation! 
        begin
            state &lt;= STATE_STOP;
            SCK   &lt;= 1'b0;
        end
        if (count[0]) // Second tick: output another bit
           shift_out &lt;= {shift_out[14:0],1'b0};
    end // case SHIFT
STATE_STOP : 
    begin
        state &lt;= STATE_IDLE;
        CS_L &lt;= 1'b1
    end

encase


Note that at the count I am not sure which value I need to stop. I can think about it very long and hard and still come up with the wrong answer so I prefer to do what is shown here: put a comment in the code to myself that I need to check that. If it is wrong it is often wrong by one. This sounds strange but putting in the right amount from the start is not important. To me it is distracting from the main work which is to build the right structure.