Creating a family hierarchy
Using a dictionary to group your data is arguably a better alternative to sorting, and building the actual output strings is a perfect fit for the .join() method of strings:

data = {}
for head, tail, kind in input_list:
    tails = data.setdefault(head, [None, []])
    kind = kind.lower()
    if kind == 'spouse' and tails[0] is None:
        # Duplicate spouse entries raise, should we do differently?
        tails[0] = tail
    elif kind == 'child':
        tails[1].append(tail)
    else:
        # Should wrong inputs be ignored, rather than raise?
        raise ValueError('Wrong input')
for head, (spouse, children) in data.items():
    print('|'.join((head, spouse, ','.join(children))))


This will print the families in some arbitrary order, but you could get them sorted by sorting the last for loop, i.e.

for head, (spouse, children) in sorted(data.items()):