Just like you can easily insert a period when you double-press the Space bar on your iPhone or iPad, this feature is also available on Mac running macOS Sierra and later. It seems to be disabled by default if you're upgrading a Mac to macOS Sierra, but it was definitely enabled by default on my brand new MacBook Pro.
While I find the feature helpful on iOS, it actually gets in the way of my typing habits on my Mac. For that reason, I have chosen to stop my Mac from adding a period at the press of a double space.