As Tim said, easy.
If they don't have under-cover shelter for bikes (and most hotels/auberges/hostals will find a garage or locked back alley with little if any prompting) then there will nearly always be a 'guardian' who will sit with the bikes all night for a small fee (less than the cost of an hour's parking in London)
Mid July will be HOT HOT HOT.....it's pretty much at the end of the peak touristy coach party season though, so stick to smaller hotels and you shouldn't have a problem just turning up and finding a room.
Bike theft is virtually unheard on in Morocco...they don't have the infrastructure, dealers or big-bike culture that we have in Europe, so there is hardly any market/desire to nick a big bike there.....The only two thefts of bikes or of parts from bikes that I know of in fact have been done by Europeans over there, presumably looking for parts to get themselves going
Farkles, tempting bits, sunglasses, odds and sods and tools are a slightly different matter....We've had gloves pinched from the luggage rack of a bike amidst a group of us and a group of shepherds in the mountains before now, and silly things left in silly places will go, taken by the local bad kid or some teenage lad who fancies himself as a wide-boy, so common sense prevails....
Other than that, don't worry, be happy, enjoy