Recently, virtualization in wireless sensor networks (WSNs) has witnessed significant attention due to the growing service domain for Internet of Things (IoT). Related literature on virtualization in WSNs explored resource optimization without considering communication failure in WSNs environments. The failure of a communication link in WSNs impacts many virtual networks running IoT services. In this context, this paper proposes a framework for optimizing fault tolerance (FT) in virtualization in WSNs, focusing on heterogeneous networks for service-oriented IoT applications. An optimization problem is formulated considering FT and communication delay as two conflicting objectives. An adapted nondominated sorting-based genetic algorithm (A-NSGA) is developed to solve the optimization problem. The major components of A-NSGA include chromosome representation, FT and delay computation, crossover and mutation, and nondominance-based sorting. Analytical and simulation-based comparative performance evaluation has been carried out. From the analysis of results, it is evident that the framework effectively optimizes FT for virtualization in WSNs.