You should call begin() only once in the setup:
void setup() {
...
Ethernet.begin()
You call
client.connect(server, 80)
but never a matching disconnect. You need to add one of these to cleanup the connection:
if (client.connect(server, 80)) {
...
client.stop();
}
An alternate approach is to re-user the previously opened connection on each loop.
// open the connection if needed
if(!client.connected()) {
client.connect(server, 80);
}
// ensure connection is available before trying to write
if(client.connected()) {
// do something with connection
}
If you are going to be transmitting very frequent small data, then this second approach is better because less time is wasted to the open/close of the connection.