@suesa you might want to clarify the PAM in your figures. When the bacteria acquires the viral (phage) DNA to incorporate into its genome it does not insert the PAM sequence (just the protospacer). In your figure it looks like the bacterial genome has the PAM sequence. The reason the bacteria does not incorporate the PAM into their genome is because if the PAM was there then the Cas proteins and crRNA and tracrRNA would cut up the bacterial DNA (this is not good for the bacteria). So the question: Why doesn't the bacterial genome get cut if it has the gRNA target sequence? It's because it does not the have the PAM sequence but the infecting phage DNA will have the PAM and hence that viral DNA is destroyed. The PAM sequence is essential for CRISPR/Cas endonuclease activity.
I see you have changed your figure. Thanks for keeping it accurate.