Well, issues and mistakes are the best way to learn.
There have been many threads about similar topics, dealing with clock generation, multiple clocks/edges inside a process, and FSMs. I highly suggest to look them up in the forum.
Apart from what we already said, there's the clock generation point. Generating clocks with pure HDL code is generally not a good idea. Again I suggest looking this up in other threads, so we do not repeat the same kind of information all over the place.
Yet another point here is how you would handle master SPI in particular. Although tempting, clocking your process(es) for SPI transmit with the SPI clock directly is often not the best idea. A much easier to synthesize approach is to use a clock with twice the frequency, and generate the SPI clock from there. This way you don't need to mess with both edges, which is full of pitfalls.