Purely from an engineering standpoint that is an attractive option. But North African countries have often been politically unstable. It's risky to place your energy security in the hands of a region that could erupt in another coup or civil war at any time.
I thought the proposal for a solar link between Morocco and the UK was a great idea. Unfortunately the UK government has decided not to back it with a contract for different guarantee.