The main function of IP addressing in computer networks is to uniquely identify devices on a network. It facilitates the routing of data across the network, ensuring that information is accurately delivered to the intended destination.