The reason for Wi-Fi getting disconnected when an Ethernet cable is plugged-in to the computer is due to the Ethernet connection being placed at higher priority level compared to the Wi-Fi network. In-fact, this is a normal & intentional setting in Windows; designed to prioritize the faster and more stable wired connection over the wireless Wi-Fi connection.
The clear advantage of this setting in Windows is that it helps in preventing the possibility of the network traffic being disturbed or disrupted due to network conflicts. Also, this setting helps in conserving battery life on a Laptop computer and provides more security by limiting access to the active network.
Prevent Wi-Fi from Disconnecting When Ethernet is Plugged In
If required, it is possible to prevent Windows from automatically disconnecting Wi-Fi network, whenever an Ethernet cable is plugged-in to the computer.
This should allow you to connect to both Ethernet and Wi-Fi network at the same time; which might be acceptable on a home Wi-Fi network, but not suitable for an office; where being connected to Wi-Fi and Ethernet at the same time can be flagged as an unsafe practice.
1. Prevent Wi-Fi from Turning OFF When Ethernet is Plugged-in
You can follow the steps below to prevent your computer from disconnecting Wi-Fi, whenever it is connected to Ethernet.
1. Go to Settings > Network & Internet > scroll down in the right-pane and click on Advanced Network Settings.

2. On the next screen, scroll down and click on More Network Adapter Options.

Windows 10: Go to Settings > Network & Internet > scroll down in the right-pane and click on Change Adapter options.
3. On Network Connections screen, right-click on Ethernet and click on Properties.

4. On “Ethernet Properties” screen, click on the Configure button located below the Wireless Adapter.

5. On the next screen, switch to Advanced tab, select Priority & VLAN entry and set its value to Disabled in the Value Field.

6. Click on OK to save this setting on your computer.
From now on, whenever you connect an Ethernet cable to the computer, you can expect the Wi-Fi Network to remain active and not get disconnected.