Spotted by Android Central,the code is effectively a bit of DRM which stops you installing an app hasn't been signed during its final build. Eventually, your phone will run a version of Android that won't be able to install apps without it.
At the moment things are not as grim as they appear. DRM has been the bane of PC gaming and rife with DRM and applications like Steam or U Play exist for the very same reason.
In this case though the DRM is a way for a developer or publisher to keep track of software versions and authenticity. Google's reason is right, for now. However there is a worry that Google might suddenly break down and start limiting how, where, when, and why we can use the apps we paid for.
Google added this metadata so you can buy an app from any approved distributor and it will work with Google Play Store features like family library and subscriptions. Apps have to be "signed" to verify their contents. Adding metadata to this signature ensures we will have DRM in every app eventually.
Android can read the metadata automatically inserted into an app and verify that it's a legitimately sourced version and approved for use by the developer. If it passes these checks, it is added to your Google Play Store library. You'll be able to update through Google Play, use things like Google Play Games for leaderboards and achievements, or share an app with people in your Family Library. And the developer can change the metadata at any time with a new signing key, which ends support for the current version and creates a new listing in Google Play.
Google says it did this for two reasons to allow developers more control over how their apps are used and to allow share apps using peer-to-peer distribution channels.