I've attended funerals for people I've never met. I went to support their family members (who I did know), so I can understand wanting to attend a funeral with a friend even if one doesn't actually know the deceased.
In my experience, unless there was some bad blood involved, it's extremely hostile to tell someone they cannot attend a funeral.
ETA: I've also never heard of issuing invitations for a funeral. Funerals are held at church, and church services are open to the public. (Again, speaking only from my own experience).
Well, in this case, the friend wasn't really mourning the deceased either - she barely knew him. And the invitation wasn't so much for the funeral, but for the hospitality offered by the family afterwards, which sounds fairly substantial (not just cookies and coffee).
I understand that, but my experience has been the same as the PP. I've never heard of "invitations" to a funeral or any sort of post-service gathering where the numbers are important. If the obituary is published (in a newspaper or online) then anyone who would like to attend is welcome, whether or not they knew the deceased personally.