what have I done wrong with this piece of code?
logic = ? (not defined) -> I assume you mean module bge.logic (from import bge)


  Module to access logic functions


getCurrentScene()


  Gets the current Scene.
  
  Return type:  bge.types.KX_Scene


A KX_Scene has no items (BGE properties)

KX_GameObjects and it's sub classes have items (properties). You can access them via GUI and via Python:

myObject[myPropertyName]





  Now I want it to be working with more objects so I thought: Let's make the name "Player" not be the name of an object but refer to every object that uses the property "Player"


When you want to process multiple objects the same way, you need to provide these objects and process each of them separate.

As your request involves two different operations I suggest to split them:

import bge
from mathutils import Vector

PROPERTY_GRAVITY = "gravity"
'Objects with that property are effected by this planet'

GRAVITY = 9.8


def applyPlanetaryForce():
    controller = bge.logic.getCurrentController()
    planet = controller.owner

    for object in findObjectsByProperty(PROPERTY_GRAVITY):
        vectorToPlanet = Vector(object.getVectTo(planet)[1])
        vectorToPlanet.length = GRAVITY
        object.applyForce(vectorToPlanet)

def findObjectsByProperty(property):
   return [object for object in bge.logic.getCurrentScene().objects
                  if property in object]   


and

import bge

PROPERTY_PLAYER = "player"
'Objects with that property are aligned to this planet'

def alignToPlanet():    
    controller = bge.logic.getCurrentController()
    planet = controller.owner

    for player in findObjectsByProperty(PROPERTY_PLAYER)
        vectorToPlanet = planet.getVectTo(player)[1]
        player.alignAxisToVect(vectorToPlanet, 2, 1)

def findObjectsByProperty(property):
   return [object for object in bge.logic.getCurrentScene().objects
                  if property in object]   


Yes, you can place both functions into the same module. They both belong to planet behavior. 

I strongly suggest not to mix these operations. It is better to keep them separate. You need one controller more, but your code does not grow into a giant mix of different requirements.

I hope it helps