Stellar clustering and orbital architecture of planetary systems