Hiding information behind logins is really bad from the usability standpoint. Imagine you are a user who googles for a certain piece of information.
Workflow on website without registration-wall:
- enter search-term into search-engine
- click on first result
- read question to confirm it's really relevant
- read answer
Workflow with registration-wall
- enter search-term into search-engine
- click on first result
- read question to confirm it's really relevant
- click on "register"
- enter username
- enter email address
open password manager, generate new password, create new entry in password manager, put it in an appropriate folder enter that default password you use everywhere
- enter password again
- enter another username because it's already taken
- solve a captcha (several times because it's unreadable)
- click confirm
- open email client
- wait for confirmation email to arrive
- click on confirmation email
- find and click on link in confirmation email
- navigate to the website you were on
- read answer
How likely is it that a user will give up, navigate back to the search-engine and just pick another result which doesn't force them to jump through all these hoops?
To be fair, some of these steps could be made more convenient for the user, like not requiring a confirmation through email, using email as username or only using a very weak captcha. But when users see a "register" button, they usually assume the worst-case which is the above procedure and make their decision whether or not they want to go through with it.
Maybe you have a good reason to force people to register. Maybe your entire business model doesn't work without forcing users to make accounts. But keep in mind that by forcing user to register to even see what value your website provides, you are driving a large fraction of them away. Now regarding the two advantages you mentioned:
a) you know exactly who your user is and you can design your website according to user's behavior
That's true, and it might even be in the best interest of the user. But keep in mind that you can perform anonymous user-tracking without requiring any user action by using cookies or localstorage (but please respect do-not-track headers of browsers). Sure, cookies aren't really persistent, but any internet user should be aware that when they want to use features on a website which require persistence between sessions, they need to register. When they do not want these features, or do not want them persisted, they will definitely appreciate the option to not register.
b) you can keep scrappers away much easier, especially if you hide the content scrappers want.
When a scraper really wants to copy your content, what stops them from just registering an account? You can't hide your content from scrapers without also hiding it from legitimate users. There are no technical ways to prevent illegal copying of web content. Only legal ways.