Most airline general call center agents are not well versed in pet travel. One usually gets a better qualified response enquiring via e-mail.
Animal handling is pretty much standard across IATA airlines. They practically all follow the same procedures. Iberia is as good as any other there. I have flown them a few times with animals within Europe, no issues at all.
The four-hour layover means it's best to retrieve and recheck him in Madrid after some outside fun time - which in turn means you need to comply with the EU animal entry regs.
Beware of this on an eventual return flight. Coming from Morocco which is classified as 'unlisted', you will need to have rabies titer bloodwork (expensive, cumbersome, three-month waiting periods) for your dog in order for him to be able to enter the EU. Customs is rather lax about this most of the time, but I would not take any chances. I routinely route flights from South America to Europe via the USA to avoid this issue, for example.
Flying LH, AF or IB, your bags will be checked through to Casablanca. You will not have to retrieve your bags in Frankfurt, Paris or Madrid unless you deliberately short-check them, so don't worry about having to carry all our stuff around during the layover.
As
JetBlue and Royal Air Maroc are partners, they will have interline agreements and you will be able to check bags (other than the dog) through from Boston to Casablanca. So no lugging everything around JFK while transiting.
Dogs are generally OK on shuttles in Western Europe. Especially with Frankfurt airport hotels. I have taken the ones from the Steigenberger and both Accor hotels to and from the airport maybe a dozen times with dogs who were always welcome.
104 pounds is 47 kgs. Borderline. I have no personal experience with AC and how strict they are with enforcing this limit. Putting him on a diet, or selecting a lighter crate to shed those two kgs isn't an option?