You can get basic third party insurance from the border, yes.
Recently though, they started only doing it there for 5 days, a month or a year for foreign registered bikes, so you'll have to pay more than you need unless you happen to be there for exactly those times.
There is a main office in Marrakech of the same company who do the insurance at the border, and in Marra you can do the insurance for any duration.....but you'd have to get there first....I've got their phone number somewhere if you'd like it and your French/Arabic is up to it
There are other companies who will do it...Carole Nash being one, but again, it's only 3rd party.
The easiest way of getting fully comp cover for Morocco is to use a European company....there are several based in Holland that a lot of the major overland tour operators use....partly because they tend to speak very good English but also because they're efficient and fairly cheap.
I've just tried to find the details on one I spoke to but I can't find the piece of paper.....I think the company was called Alessi, and they were very helpful.
PS It's also worth going higher up in your own insurance company....Morocco is in the European green card agreement so technically, they should be covered....some people have found that if you push, you can get the green card amended to specifically include the word 'Morocco' or at the very least the international abbreviation 'Ma' listed on the green card.
Ebike insurance are one who definitely don't, as they're based in Gibraltar and operate under different rules.
(Mind you, with the experience Marion's had with Ebike Insurance recently, who the fekk's going to stay with them anyway
)