Just gonna hit the high points here ---
Outboards are mounted on the very aft end of the boat. Different weights change the center of balance of the boat. If you change the center of balance by adding more weight you change the way the boat handles and it can become unsafe. In a inboard the center of balance also has a lot to do with engine placement and weight but because it is in a position of less leverage it is not as succeptable to changes in engine weight. If there is a dramatic change of weight in an inboard engine, the position of the engine can be changed to relocate the center of balance to a safe position.
HP ratings for outboards are as much related to weight as they are to how fast the boat can go. As was mentioned before, the HP rating is assigned by the manufacturer to meet a number of requirements. First, if it's under 20' it has to level float. Second, the max load rating has to have a reasonable amount of excess above and beyond the engine weight so that the boat is not easily overloaded. Third, outboard boats are not sold with motors (mentioned above). Any motor above 25 hp or motors with full controls are not sold directly to the public, you must buy them and have them correctly rigged by a dealer. This ensures that an oversized motor is not installed on a boat and is a portion of meeting the manufacturers warranty requirements.
Is it against the law for you to install a motor of a higher hp rating than the nameplate say's. No, however, if there is an accident it would be an easy target for a negligence suit. I ran a hot rod motor on a boat and just changed the cowling decals so it was within the max hp of the boat. Nobody but me knew approximately what the hp was and the USCG never questioned it when I went through a voluntary inspection. In otherwords, if you don't tell them, they have no way of proving otherwise unless it's blatently obvious.