The card networks are different. Depending on the type selected, the call to the different networks are identified.
Now the website that is asking the user to input the number can parse the number and then decide as to which network it belongs and accordingly invoke the respective call.
However this would go against the principal of accepting the user input and making the right call. From a security standpoint, the website is not supposed to store/process your card info, but take it as is and pass it on for authentication to the respective network.
Hence its a more clean design where by user is asked to input the type of card, and whatever value the user enters is passed on to the said network. It is now for the network to validate it and return Pass/Fail.
Plus from a UI point of you, it shows the user easily what cards are supported for payment on the said gateway. Yes this information can also be put else where, but there is no guarantee that the user would read it. Forcing him to select a value make sure that he is using a right card that is supported by the website.