When creating a membership for a contact that is, say, a member of a household, the API doesn't properly create the memberships for the related contacts. The problems is that in the API call, the API uses CRM_Member_BAO_Membership::checkMembershipRelationship that returns an array of the related contacts. The returned array is a set of "contact_id" => "relationship_type_id" pairs, and the API code expects just "index" => "contact_id" pairs.
The code in the API currently looks like this:
foreach ( $relatedContacts as $contactId )
And it should look like this:
foreach ( $relatedContacts as $contactId => $relationTypeId )