Incorrect behavior in `pandas.merge` function
- [x] I have checked that this issue has not already been reported.

- [x] I have confirmed this bug exists on the latest version of pandas.

- [ ] (optional) I have confirmed this bug exists on the master branch of pandas.

---

**Note**: Please read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports) detailing how to provide the necessary information for us to reproduce your bug.

#### Code Sample, a copy-pastable example

```python
import pandas
import numpy as np

test_data = np.random.uniform(0, 100, size=(2 ** 7, 2 ** 6))
test_data2 = np.random.uniform(0, 100, size=(2 ** 6, 2 ** 6))

pandas_df = pandas.DataFrame(
   test_data,
   columns=["col{}".format(i) for i in range(test_data.shape[1])],
   index=pandas.Index(
   [i for i in range(1, test_data.shape[0] + 1)], name="key"
   ),
)
pandas_df2 = pandas.DataFrame(
   test_data2,
   columns=["col{}".format(i) for i in range(test_data2.shape[1])],
   index=pandas.Index(
   [i for i in range(1, test_data2.shape[0] + 1)], name="key"
   ),
)

pandas_result = pandas_df.merge(pandas_df2,how="left",right_on="key",left_index=True,sort=False)
pandas_result2 = pandas_df.merge(pandas_df2,how="inner",right_on="key",left_index=True,sort=False)

pandas_result
     key     col0_x     col1_x     col2_x     col3_x     col4_x     col5_x     col6_x     col7_x  ...    col55_y    col56_y    col57_y    col58_y    col59_y    col60_y    col61_y    col62_y    col63_y
1.0    1  22.268792  91.710456  35.425585   5.998272   7.616223  50.855316  70.778027  39.345351  ...  79.470662   1.139462  82.394800  49.279405  71.492669  19.118798   8.338031  15.240684  96.935519
2.0    2  24.359239  24.789241  83.329200  24.369174  92.494368  48.520427  73.401821  47.736986  ...  77.504507  83.228024  16.743863  28.598973  89.282114  24.783087  94.681264  76.430020  49.957027
3.0    3  66.973326  85.911902  85.839220  39.444853  43.164051   0.711455   1.728169  67.356380  ...  82.361473  69.188814  19.254839  80.721210  97.038337  50.344042  47.969856  33.863619  22.711405
4.0    4  64.578630  64.185421  97.307670  10.697612  38.090190  63.198376  91.842608  58.068671  ...  10.917623  98.375547  69.298407  69.486654  26.956081  14.512972  38.663965  44.573867  67.612123
5.0    5  73.212801  41.605993  79.149803   0.545511  61.767295  80.562112  78.970619  89.752911  ...  36.965341  99.078379  72.797682  28.273150  50.379084  14.131667  33.817043  64.267731  15.687369
..   ...        ...        ...        ...        ...        ...        ...        ...        ...  ...        ...        ...        ...        ...        ...        ...        ...        ...        ...
NaN  124  13.955523  91.797658  44.563825  60.746861  28.904216  71.772330  28.841887  89.951210  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN
NaN  125  49.694130  56.604940  92.628512  14.191864  31.197524  82.710209  95.428222  35.449014  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN
NaN  126  58.950112  76.638796  89.459637  86.865600  93.866105   3.612650  88.072591  20.871411  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN
NaN  127  76.472780  72.939919  24.263068  71.021804  89.470422  29.811838  14.484325  51.755485  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN
NaN  128  97.720457  31.118757  85.992609  85.823341  69.280047  71.261342  62.747467  23.256187  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN

[128 rows x 129 columns]

pandas_result2
        col0_x     col1_x     col2_x     col3_x     col4_x     col5_x     col6_x     col7_x     col8_x  ...    col55_y    col56_y    col57_y    col58_y    col59_y    col60_y    col61_y    col62_y    col63_y
key                                                                                                     ...
1    22.268792  91.710456  35.425585   5.998272   7.616223  50.855316  70.778027  39.345351  25.069931  ...  79.470662   1.139462  82.394800  49.279405  71.492669  19.118798   8.338031  15.240684  96.935519
2    24.359239  24.789241  83.329200  24.369174  92.494368  48.520427  73.401821  47.736986  32.137170  ...  77.504507  83.228024  16.743863  28.598973  89.282114  24.783087  94.681264  76.430020  49.957027
3    66.973326  85.911902  85.839220  39.444853  43.164051   0.711455   1.728169  67.356380  83.307993  ...  82.361473  69.188814  19.254839  80.721210  97.038337  50.344042  47.969856  33.863619  22.711405
4    64.578630  64.185421  97.307670  10.697612  38.090190  63.198376  91.842608  58.068671  17.910149  ...  10.917623  98.375547  69.298407  69.486654  26.956081  14.512972  38.663965  44.573867  67.612123
5    73.212801  41.605993  79.149803   0.545511  61.767295  80.562112  78.970619  89.752911  44.926515  ...  36.965341  99.078379  72.797682  28.273150  50.379084  14.131667  33.817043  64.267731  15.687369
..         ...        ...        ...        ...        ...        ...        ...        ...        ...  ...        ...        ...        ...        ...        ...        ...        ...        ...        ...
60   40.822611  50.875277  84.380647  26.325878  46.883415   0.048349  94.366177  10.860537  95.910254  ...  16.139270  16.442644  38.910856  52.139794  75.130737  79.407901   9.574825  43.741220  71.341946
61   79.372509  92.123416  60.440763  24.429257  58.681905  27.281294  24.816561  53.338771  37.340585  ...  17.580590  49.181221  23.445983  46.408847   1.805793  72.093458  46.068460  86.171202  67.535472
62   73.059258  86.432887  52.869162  26.113074  21.653439  18.971489  86.998840  36.259379  55.659895  ...  34.785796   2.524984  63.754044  21.315063  26.431136   9.647946   9.740197  55.826159  81.770851
63   73.177085  48.520687   6.165317  75.703392  32.593617  15.452280   0.227452   1.036644  90.657810  ...  30.676622   2.000542   6.701021  78.782964  50.210517  71.748162  43.102752  89.775608  51.033208
64   30.236389  10.706612  31.498764   0.872496  88.008391  65.306584  92.053531  98.306667  28.063389  ...  90.833733  35.615374  12.593278   4.371464  66.767380  11.140186  79.031274  23.489189  56.079695

[64 rows x 128 columns]
```

#### Problem description

My expectation was that both `pandas_result` and `pandas_result2` will preserve index with name `key` after performing the operations mentioned above. It turned out that `index` will be preserved if `how="inner"`, whereas when `how="left"` index will be moved into column.

#### Expected Output

```python
        col0_x     col1_x     col2_x     col3_x     col4_x     col5_x     col6_x     col7_x     col8_x  ...    col55_y    col56_y    col57_y    col58_y    col59_y    col60_y    col61_y    col62_y    col63_y
key                                                                                                     ...
1    22.268792  91.710456  35.425585   5.998272   7.616223  50.855316  70.778027  39.345351  25.069931  ...  79.470662   1.139462  82.394800  49.279405  71.492669  19.118798   8.338031  15.240684  96.935519
2    24.359239  24.789241  83.329200  24.369174  92.494368  48.520427  73.401821  47.736986  32.137170  ...  77.504507  83.228024  16.743863  28.598973  89.282114  24.783087  94.681264  76.430020  49.957027
3    66.973326  85.911902  85.839220  39.444853  43.164051   0.711455   1.728169  67.356380  83.307993  ...  82.361473  69.188814  19.254839  80.721210  97.038337  50.344042  47.969856  33.863619  22.711405
4    64.578630  64.185421  97.307670  10.697612  38.090190  63.198376  91.842608  58.068671  17.910149  ...  10.917623  98.375547  69.298407  69.486654  26.956081  14.512972  38.663965  44.573867  67.612123
5    73.212801  41.605993  79.149803   0.545511  61.767295  80.562112  78.970619  89.752911  44.926515  ...  36.965341  99.078379  72.797682  28.273150  50.379084  14.131667  33.817043  64.267731  15.687369
..         ...        ...        ...        ...        ...        ...        ...        ...        ...  ...        ...        ...        ...        ...        ...        ...        ...        ...        ...
124  13.955523  91.797658  44.563825  60.746861  28.904216  71.772330  28.841887  89.951210  69.801427  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN
125  49.694130  56.604940  92.628512  14.191864  31.197524  82.710209  95.428222  35.449014  84.495449  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN
126  58.950112  76.638796  89.459637  86.865600  93.866105   3.612650  88.072591  20.871411   9.433378  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN
127  76.472780  72.939919  24.263068  71.021804  89.470422  29.811838  14.484325  51.755485  41.570147  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN
128  97.720457  31.118757  85.992609  85.823341  69.280047  71.261342  62.747467  23.256187  87.411083  ...        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN        NaN

[128 rows x 128 columns]
```

#### Output of ``pd.show_versions()``

<details>

INSTALLED VERSIONS
------------------
commit           : None
python           : 3.7.7.final.0
python-bits      : 64
OS               : Windows
OS-release       : 10
machine          : AMD64
processor        : Intel64 Family 6 Model 142 Stepping 10, GenuineIntel
byteorder        : little
LC_ALL           : None
LANG             : None
LOCALE           : None.None

pandas           : 1.0.5
numpy            : 1.18.4
pytz             : 2020.1
dateutil         : 2.8.1
pip              : 20.1.1
setuptools       : 41.2.0
Cython           : None
pytest           : 5.4.2
hypothesis       : None
sphinx           : None
blosc            : None
feather          : 0.4.1
xlsxwriter       : None
lxml.etree       : 4.5.0
html5lib         : None
pymysql          : None
psycopg2         : None
jinja2           : 2.11.2
IPython          : 7.14.0
pandas_datareader: None
bs4              : 4.9.1
bottleneck       : None
fastparquet      : None
gcsfs            : None
lxml.etree       : 4.5.0
matplotlib       : 3.2.1
numexpr          : 2.7.1
odfpy            : None
openpyxl         : 3.0.3
pandas_gbq       : None
pyarrow          : 0.16.0
pytables         : None
pytest           : 5.4.2
pyxlsb           : None
s3fs             : 0.4.2
scipy            : 1.4.1
sqlalchemy       : 1.3.17
tables           : 3.6.1
tabulate         : None
xarray           : 0.15.1
xlrd             : 1.2.0
xlwt             : None
xlsxwriter       : None
numba            : None

</details>
