No, it is not illegal to view someone's Facebook profile. Social media is just that … social. Frequently viewing a person’s profile doesn’t constitute harassment.